Download run.py from ElliNet13/timer: direct link, hf CLI and curl.
- Browser
- Download file 408 Bytes
-
https://huggingface.co/spaces/ElliNet13/timer/resolve/main/run.py
- Command line
-
hf download hf://spaces/ElliNet13/timer/run.py
-
curl -L -o run.py https://huggingface.co/spaces/ElliNet13/timer/resolve/main/run.py
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() | |