2001muhammadumair commited on
Commit
7d8c3f6
·
verified ·
1 Parent(s): 2fd9e56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -3,12 +3,20 @@ from PIL import Image
3
  import torch
4
  from transformers import AutoModelForImageClassification, AutoFeatureExtractor
5
  from groq import Groq
 
 
6
 
7
- # Securely load GROQ API key
8
- grog_api_key = "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"
9
- if not grog_api_key:
 
 
 
 
10
  raise ValueError("GROQ_API_KEY environment variable not set.")
11
- client = Groq(api_key=grog_api_key)
 
 
12
 
13
  # Expanded dictionary with treatments for various diseases
14
  disease_treatments = {
 
3
  import torch
4
  from transformers import AutoModelForImageClassification, AutoFeatureExtractor
5
  from groq import Groq
6
+ from dotenv import load_dotenv
7
+ import os
8
 
9
+
10
+ # Load environment variables from the .env file
11
+ load_dotenv()
12
+
13
+ # Securely get the GROQ API key from environment variables
14
+ groq_api_key = os.getenv("GROQ_API_KEY")
15
+ if not groq_api_key:
16
  raise ValueError("GROQ_API_KEY environment variable not set.")
17
+
18
+ # Initialize the client with the API key
19
+ client = Groq(api_key=groq_api_key)
20
 
21
  # Expanded dictionary with treatments for various diseases
22
  disease_treatments = {