Update run.py
Browse files
run.py
CHANGED
|
@@ -1,12 +1,18 @@
|
|
| 1 |
import time
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
-
def slow_echo(
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
yield
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
demo = gr.ChatInterface(
|
| 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()
|