ElliNet13 commited on
Commit
62c3616
·
verified ·
1 Parent(s): 33f15b3

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +11 -5
run.py CHANGED
@@ -1,12 +1,18 @@
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.05)
7
- yield "You typed: " + message[: i+1]
 
 
 
 
 
 
8
 
9
- demo = gr.ChatInterface(slow_echo).queue()
10
 
11
  if __name__ == "__main__":
12
  demo.launch()
 
1
  import time
2
  import gradio as gr
3
 
4
+ def slow_echo(stringNum, history):
5
+ try:
6
+ num = int(stringNum)
7
+ yield stringNum
8
+ while num > 0:
9
+ yield str(num)
10
+ num -= 1
11
+ yield "0 - Countdown done!"
12
+ except ValueError:
13
+ yield "Error: Message not int."
14
 
15
+ demo = gr.ChatInterface(timer).queue()
16
 
17
  if __name__ == "__main__":
18
  demo.launch()