miojizzy commited on
Commit
d508011
·
1 Parent(s): 07f757d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -2
app.py CHANGED
@@ -59,10 +59,27 @@ with gr.Blocks() as demo2:
59
  #btn.click(add_segment, inputs=segms, outputs=segms)
60
 
61
  gr.Markdown("*****")
62
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  gr.Examples([os.path.join(os.path.dirname(__file__), "test.mp4")], inputs=input_video)
64
 
65
-
66
 
67
 
68
  if __name__ == "__main__":
 
59
  #btn.click(add_segment, inputs=segms, outputs=segms)
60
 
61
  gr.Markdown("*****")
62
+ def calculator(num1, operation, num2):
63
+ if operation == "add":
64
+ return num1 + num2
65
+ elif operation == "subtract":
66
+ return num1 - num2
67
+ elif operation == "multiply":
68
+ return num1 * num2
69
+ elif operation == "divide":
70
+ return num1 / num2
71
+ gr.Interface(
72
+ calculator,[
73
+ "number",
74
+ gr.Radio(["add", "subtract", "multiply", "divide"]),
75
+ "number"
76
+ ],
77
+ "number",
78
+ live=True,
79
+ )
80
+ gr.Markdown("*****")
81
  gr.Examples([os.path.join(os.path.dirname(__file__), "test.mp4")], inputs=input_video)
82
 
 
83
 
84
 
85
  if __name__ == "__main__":