tbaig1605 commited on
Commit
111e99e
·
verified ·
1 Parent(s): 0c35d01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,8 +1,9 @@
1
  import gradio as gr
2
  import requests
 
3
 
4
- # Replace with your actual API key (keep it secure)
5
- GROQ_API_KEY = os.getenv("API")
6
 
7
  # Groq API endpoint
8
  API_URL = "https://api.groq.com/openai/v1/chat/completions"
@@ -55,3 +56,4 @@ with gr.Blocks() as demo:
55
 
56
  # Launch the app
57
  demo.launch(share=False) # Setting share=False, since Hugging Face handles sharing
 
 
1
  import gradio as gr
2
  import requests
3
+ import os # Add this line to import the os module
4
 
5
+ # Access the secret API key from environment variables
6
+ GROQ_API_KEY = os.getenv("API") # Ensure the secret key name matches the one you set in Hugging Face
7
 
8
  # Groq API endpoint
9
  API_URL = "https://api.groq.com/openai/v1/chat/completions"
 
56
 
57
  # Launch the app
58
  demo.launch(share=False) # Setting share=False, since Hugging Face handles sharing
59
+