Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
|
|
|
| 3 |
|
| 4 |
-
#
|
| 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 |
+
|