Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def calculator(num1, operation, num2):
|
4 |
-
if operation == "
|
5 |
return num1 + num2
|
6 |
-
elif operation == "
|
7 |
return num1 - num2
|
8 |
-
elif operation == "
|
9 |
return num1 * num2
|
10 |
-
elif operation == "
|
11 |
return num1 / num2
|
12 |
|
13 |
|
@@ -15,7 +15,7 @@ demo = gr.Interface(
|
|
15 |
fn=calculator,
|
16 |
inputs=[
|
17 |
gr.Number(value=4),
|
18 |
-
gr.Radio(["
|
19 |
"number"
|
20 |
],
|
21 |
outputs="number",
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def calculator(num1, operation, num2):
|
4 |
+
if operation == "+":
|
5 |
return num1 + num2
|
6 |
+
elif operation == "-":
|
7 |
return num1 - num2
|
8 |
+
elif operation == "*":
|
9 |
return num1 * num2
|
10 |
+
elif operation == "/":
|
11 |
return num1 / num2
|
12 |
|
13 |
|
|
|
15 |
fn=calculator,
|
16 |
inputs=[
|
17 |
gr.Number(value=4),
|
18 |
+
gr.Radio(["+", "-", "*", "/"]),
|
19 |
"number"
|
20 |
],
|
21 |
outputs="number",
|