Poojashetty357 commited on
Commit
6f8a7a1
·
verified ·
1 Parent(s): 562e261

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,6 +1,9 @@
1
- #from google.colab import userdata # Secure storage for API keys in Colab
2
-
3
- groq_api_key = userdata.get("GROQ_API_KEY")
 
 
 
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()