Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
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 |
+
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 = {
|