Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,17 +19,18 @@ def generate_text(input_text, history):
|
|
| 19 |
response = output['choices'][0]['text']
|
| 20 |
history.append([input_text, response])
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
with gr.Blocks() as demo:
|
| 25 |
chatbot = gr.Chatbot()
|
| 26 |
msg = gr.Textbox()
|
| 27 |
clear = gr.ClearButton([msg, chatbot])
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
demo.queue(concurrency_count=1, max_size=5)
|
| 34 |
demo.launch()
|
| 35 |
|
|
|
|
| 19 |
response = output['choices'][0]['text']
|
| 20 |
history.append([input_text, response])
|
| 21 |
|
| 22 |
+
for i in range(len(response)):
|
| 23 |
+
time.sleep(0.3)
|
| 24 |
+
yield "You typed: " + message[: i+1]
|
| 25 |
+
|
| 26 |
+
|
| 27 |
|
| 28 |
with gr.Blocks() as demo:
|
| 29 |
chatbot = gr.Chatbot()
|
| 30 |
msg = gr.Textbox()
|
| 31 |
clear = gr.ClearButton([msg, chatbot])
|
| 32 |
|
| 33 |
+
demo = gr.ChatInterface(generate_text)
|
|
|
|
|
|
|
|
|
|
| 34 |
demo.queue(concurrency_count=1, max_size=5)
|
| 35 |
demo.launch()
|
| 36 |
|