typesdigital commited on
Commit
c8012c7
·
1 Parent(s): f277e70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -1,15 +1,16 @@
 
1
  import interpreter
2
 
3
- # Paste your OpenAI API key below.
4
- interpreter.api_key = "your_openai_api_key"
5
-
6
- import interpreter
7
-
8
- # Paste your OpenAI API key below.
9
  interpreter.api_key = "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"
10
 
11
- interpreter.model = "gpt-3.5-turbo"
 
 
 
12
 
13
- interpreter.auto_run = True
 
14
 
15
- interpreter.chat()
 
 
1
+ import gradio as gr
2
  import interpreter
3
 
4
+ # Set your OpenAI API key
 
 
 
 
 
5
  interpreter.api_key = "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"
6
 
7
+ # Define the chat function using the interpreter library
8
+ def chat(input_text):
9
+ response = interpreter.chat(input_text)
10
+ return response
11
 
12
+ # Create a Gradio interface
13
+ iface = gr.Interface(fn=chat, inputs="text", outputs="text", live=True)
14
 
15
+ # Launch the interface
16
+ iface.launch()