Spaces:
Runtime error
Runtime error
Commit ·
ae024e4
1
Parent(s): 327cc32
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import interpreter
|
| 3 |
|
| 4 |
-
interpreter.api_key = "
|
| 5 |
-
interpreter.auto_run = True
|
| 6 |
|
| 7 |
def chat(input):
|
| 8 |
output = interpreter.chat(input)
|
|
@@ -12,15 +12,16 @@ def reset():
|
|
| 12 |
interpreter.reset()
|
| 13 |
return "Chat history reset"
|
| 14 |
|
| 15 |
-
iface = gr.Interface(
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
| 23 |
|
| 24 |
-
iface.queue(reset, [], "button"
|
| 25 |
|
| 26 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import interpreter
|
| 3 |
|
| 4 |
+
interpreter.api_key = "YOUR_OPENAI_API_KEY"
|
| 5 |
+
interpreter.auto_run = True
|
| 6 |
|
| 7 |
def chat(input):
|
| 8 |
output = interpreter.chat(input)
|
|
|
|
| 12 |
interpreter.reset()
|
| 13 |
return "Chat history reset"
|
| 14 |
|
| 15 |
+
iface = gr.Interface(
|
| 16 |
+
fn=chat,
|
| 17 |
+
inputs="text",
|
| 18 |
+
outputs="text",
|
| 19 |
+
examples=[
|
| 20 |
+
["Hello", "Hi there!"],
|
| 21 |
+
["What is 2 + 2?", "4"]
|
| 22 |
+
]
|
| 23 |
+
)
|
| 24 |
|
| 25 |
+
iface.queue(reset, [], "button")
|
| 26 |
|
| 27 |
iface.launch()
|