awacke1's picture
Create new file
506e4bb
raw
history blame
484 Bytes
import gradio as gr
def calculator(text1, operation, text2):
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,
[
"text",
gr.Radio(["add", "subtract", "multiply", "divide"]),
"text"
],
"number",
live=True,
)
demo.launch()