jhj0517
commited on
Commit
•
322f8e9
1
Parent(s):
f61df36
Add application file
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def predict_with_my_model(param1: int, param2:int):
|
4 |
+
return param1+param2
|
5 |
+
|
6 |
+
app = gr.Blocks()
|
7 |
+
with app:
|
8 |
+
input1 = gr.Slider(minimum=0, maximum=10)
|
9 |
+
input2 = gr.Number()
|
10 |
+
predict_btn = gr.Button()
|
11 |
+
output = gr.Number()
|
12 |
+
|
13 |
+
predict_btn.click(
|
14 |
+
fn=predict_with_my_model,
|
15 |
+
inputs=[input1, input2],
|
16 |
+
outputs=[output]
|
17 |
+
)
|
18 |
+
|
19 |
+
|
20 |
+
app.launch()
|