Spaces:
Sleeping
Sleeping
interiv@qq.com commited on
Commit ·
2ad381c
1
Parent(s): a23f931
增加第一个文件
Browse files
main.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
def my_add(a, b):
|
| 5 |
+
return a + b
|
| 6 |
+
with gr.Blocks() as myblock:
|
| 7 |
+
a = gr.Slider(minimum=0, maximum=10)
|
| 8 |
+
b = gr.Slider(minimum=0, maximum=10)
|
| 9 |
+
c = gr.Label()
|
| 10 |
+
button=gr.Button(label="Click me")
|
| 11 |
+
button.click(my_add,[a, b], c)
|
| 12 |
+
|
| 13 |
+
myblock.launch(share=True )
|