Spaces:
Runtime error
Runtime error
import gradio as gr | |
def calculator(text1, operation, text2): | |
if operation == "add": | |
return text1 + text2 | |
elif operation == "subtract": | |
return text1 - text2 | |
elif operation == "multiply": | |
return text1 * text2 | |
elif operation == "divide": | |
return text1 / text2 | |
demo = gr.Interface( | |
calculator, | |
[ | |
"text", | |
gr.Radio(["add", "subtract", "multiply", "divide"]), | |
"text" | |
], | |
"text", | |
live=True, | |
) | |
demo.launch() |