Spaces:
Runtime error
Runtime error
yielding
Browse files
app.py
CHANGED
|
@@ -1,7 +1,11 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def chat(message, history):
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
demo = gr.ChatInterface(
|
| 7 |
fn=chat,
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import time
|
| 3 |
|
| 4 |
def chat(message, history):
|
| 5 |
+
answer = str(message)
|
| 6 |
+
for i in range(len(answer)):
|
| 7 |
+
time.sleep(0.3)
|
| 8 |
+
yield answer[:i+1]
|
| 9 |
|
| 10 |
demo = gr.ChatInterface(
|
| 11 |
fn=chat,
|