Update run.py
Browse files123456789101112import timeimport gradio as grdef slow_echo(message, history):for i in range(len(message)):time.sleep(0.05)yield "You typed: " + message[: i+1]demo = gr.ChatInterface(slow_echo).queue()if __name__ == "__main__":demo.launch()123456789101112131415161718import timeimport gradio as grdef slow_echo(stringNum, history):try:num = int(stringNum)yield stringNumwhile num > 0:yield str(num)num -= 1yield "0 - Countdown done!"except ValueError:yield "Error: Message not int."demo = gr.ChatInterface(timer).queue()if __name__ == "__main__":demo.launch()
run.py+11-5