timer / run.py
ElliNet13's picture
WAIT
40a98c7 verified
raw
history blame contribute delete
408 Bytes
import time
import gradio as gr
def timer(stringNum, history):
try:
num = int(stringNum)
yield stringNum
while num > 0:
yield str(num)
time.sleep(1)
num -= 1
yield "0 - Countdown done!"
except ValueError:
yield "Error: Message not int."
demo = gr.ChatInterface(timer).queue()
if __name__ == "__main__":
demo.launch()