Download app.py from bin20/testtest: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/bin20/testtest/resolve/main/app.py
- Command line
-
hf download hf://spaces/bin20/testtest/app.py
-
curl -L -o app.py https://huggingface.co/spaces/bin20/testtest/resolve/main/app.py
417 Bytes
| import gradio as gr | |
| def greet(name, is_morning, temperature): | |
| salutation = "Good morning" if is_morning else "Good evening" | |
| greeting = f"{salutation} {name}. It is {temperature} degrees today" | |
| celsius = (temperature - 32) * 5 / 9 | |
| return greeting, round(celsius, 2) | |
| demo = gr.Interface( | |
| fn=greet, | |
| inputs=["text", "checkbox", gr.Slider(0, 100)], | |
| outputs=["text", "number"], | |
| ) | |
| demo.launch() |