Spaces:
Runtime error
Runtime error
Commit ·
327cc32
1
Parent(s): 4a65842
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 = "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"
|
| 5 |
-
interpreter.auto_run = True
|
| 6 |
|
| 7 |
def chat(input):
|
| 8 |
output = interpreter.chat(input)
|
|
@@ -10,18 +10,17 @@ def chat(input):
|
|
| 10 |
|
| 11 |
def reset():
|
| 12 |
interpreter.reset()
|
| 13 |
-
return "Chat history reset"
|
| 14 |
|
| 15 |
-
iface = gr.Interface(
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
)
|
| 25 |
|
| 26 |
-
iface.queue(reset, [], "button")
|
| 27 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import interpreter
|
| 3 |
|
| 4 |
+
interpreter.api_key = "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"
|
| 5 |
+
interpreter.auto_run = True
|
| 6 |
|
| 7 |
def chat(input):
|
| 8 |
output = interpreter.chat(input)
|
|
|
|
| 10 |
|
| 11 |
def reset():
|
| 12 |
interpreter.reset()
|
| 13 |
+
return "Chat history reset"
|
| 14 |
|
| 15 |
+
iface = gr.Interface(fn=chat,
|
| 16 |
+
inputs="text",
|
| 17 |
+
outputs="text",
|
| 18 |
+
examples=[
|
| 19 |
+
["What is the capital of France?", "Paris"],
|
| 20 |
+
["What is 10 + 14?", "24"]
|
| 21 |
+
]
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
iface.queue(reset, [], "button", concurrency_count=1)
|
| 25 |
|
|
|
|
| 26 |
iface.launch()
|