John Liao commited on
Commit
f118281
·
verified ·
1 Parent(s): 3aa933f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -1,10 +1,9 @@
1
- import random
2
  import gradio as gr
3
 
4
- def alternatingly_agree(message, history):
5
- if len(history) % 2 == 0:
6
- return f"Yes, I do think that '{message}'"
7
- else:
8
- return "I don't think so"
9
 
10
- gr.ChatInterface(alternatingly_agree).launch(share=True)
 
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(slow_echo).launch()