Spaces:
Sleeping
Sleeping
added app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
def slow_echo(message, history):
|
| 5 |
+
for i in range(len(message)):
|
| 6 |
+
time.sleep(0.3)
|
| 7 |
+
yield "You typed: " + message[: i+1]
|
| 8 |
+
|
| 9 |
+
gr.ChatInterface(
|
| 10 |
+
fn=slow_echo,
|
| 11 |
+
type="messages"
|
| 12 |
+
).launch()
|