awacke1 commited on
Commit
506e4bb
1 Parent(s): 6d90c5a

Create new file

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def calculator(text1, operation, text2):
4
+ if operation == "add":
5
+ return num1 + num2
6
+ elif operation == "subtract":
7
+ return num1 - num2
8
+ elif operation == "multiply":
9
+ return num1 * num2
10
+ elif operation == "divide":
11
+ return num1 / num2
12
+
13
+ demo = gr.Interface(
14
+ calculator,
15
+ [
16
+ "text",
17
+ gr.Radio(["add", "subtract", "multiply", "divide"]),
18
+ "text"
19
+ ],
20
+ "number",
21
+ live=True,
22
+ )
23
+ demo.launch()