Spaces:
Running
Running
Download app.py from crocacrola/yeahpyc: direct link, hf CLI and curl.
- Browser
- Download file 487 Bytes
-
https://huggingface.co/spaces/crocacrola/yeahpyc/resolve/refs%2Fpr%2F1/app.py
- Command line
-
hf download hf://spaces/crocacrola/yeahpyc@refs/pr/1/app.py
-
curl -L -o app.py https://huggingface.co/spaces/crocacrola/yeahpyc/resolve/refs%2Fpr%2F1/app.py
487 Bytes
| import gradio as gr | |
| def calculator(num1, operation, num2): | |
| if operation == "add": | |
| return num1 + num2 | |
| elif operation == "subtract": | |
| return num1 - num2 | |
| elif operation == "multiply": | |
| return num1 * num2 | |
| elif operation == "divide": | |
| return num1 / num2 | |
| demo = gr.Interface( | |
| calculator, | |
| [ | |
| "number", | |
| gr.Radio(["add", "subtract", "multiply", "divide"]), | |
| "number" | |
| ], | |
| "number", | |
| live=True, | |
| ) | |
| demo.launch() | |