mindspark121 commited on
Commit
d08a783
Β·
verified Β·
1 Parent(s): 40c51a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -12,11 +12,12 @@ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
12
  app = FastAPI()
13
 
14
  # βœ… Securely Fetch API Key
15
- GROQ_API_KEY = os.getenv("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") # Use environment variable for security
16
  if not GROQ_API_KEY:
17
  raise ValueError("GROQ_API_KEY is missing. Set it as an environment variable.")
18
 
19
- client = Groq(api_key=GROQ_API_KEY)
 
20
 
21
  # βœ… Load AI Models
22
  similarity_model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2")
 
12
  app = FastAPI()
13
 
14
  # βœ… Securely Fetch API Key
15
+ GROQ_API_KEY = os.getenv("GROQ_API_KEY") # βœ… FIXED
16
  if not GROQ_API_KEY:
17
  raise ValueError("GROQ_API_KEY is missing. Set it as an environment variable.")
18
 
19
+ client = Groq(api_key=GROQ_API_KEY) # βœ… Ensure the API key is passed correctly
20
+
21
 
22
  # βœ… Load AI Models
23
  similarity_model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2")