awacke1's picture
Update app.py
bd6bfc3
raw
history blame
490 Bytes
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()