Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
# Define the URL for the Groq API endpoint
|
6 |
url = "https://api.groq.com/openai/v1/chat/completions"
|
@@ -36,4 +39,5 @@ interface = gr.Interface(
|
|
36 |
)
|
37 |
|
38 |
# Launch Gradio app
|
|
|
39 |
interface.launch()
|
|
|
1 |
+
#for huggingface you need to set env seperately and save a app.py file
|
2 |
+
import os
|
3 |
+
import requests
|
4 |
+
import gradio as gr
|
5 |
+
#Retrieve the API key from the environment variable
|
6 |
+
groq_api_key = os.getenv("groq")
|
7 |
|
8 |
# Define the URL for the Groq API endpoint
|
9 |
url = "https://api.groq.com/openai/v1/chat/completions"
|
|
|
39 |
)
|
40 |
|
41 |
# Launch Gradio app
|
42 |
+
if __name__ == "__main__":
|
43 |
interface.launch()
|