Nick088 commited on
Commit
9551276
1 Parent(s): 5e72808

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,6 +1,12 @@
 
 
1
  import gradio as gr
2
  from groq import Groq
3
 
 
 
 
 
4
  def generate_response(input_text):
5
  client = Groq()
6
 
@@ -24,8 +30,8 @@ def generate_response(input_text):
24
  return response
25
 
26
  # Define the Gradio UI
27
- inputs = gr.inputs.Textbox(label="Enter your question")
28
- outputs = gr.outputs.Textbox(label="Model Response")
29
 
30
  gr.Interface(
31
  fn=generate_response,
 
1
+ import subprocess
2
+ import os
3
  import gradio as gr
4
  from groq import Groq
5
 
6
+ groq_api_key = os.environ('Groq_Api_key')
7
+
8
+ subprocess.run(["export", f"GROQ_API_KEY={groq_api_key}"], check=True)
9
+
10
  def generate_response(input_text):
11
  client = Groq()
12
 
 
30
  return response
31
 
32
  # Define the Gradio UI
33
+ inputs = gr.Textbox(label="Enter your question")
34
+ outputs = gr.Textbox(label="Model Response")
35
 
36
  gr.Interface(
37
  fn=generate_response,