Update app.py
Browse files
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 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
raise ValueError("GROQ_API_KEY environment variable not set.")
|
11 |
-
|
|
|
|
|
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 = {
|