2001muhammadumair commited on
Commit
b1d6fb7
·
verified ·
1 Parent(s): b61a67c

Update app.py

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