Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import spaces
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
@spaces.GPU(duration=181)
|
| 6 |
+
def inner_fn():
|
| 7 |
+
return "test"
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def wrapper_fn():
|
| 11 |
+
return inner_fn()
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
#wrapper_fn.zerogpu = True
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
with gr.Blocks() as demo:
|
| 18 |
+
btn = gr.Button()
|
| 19 |
+
out = gr.Textbox()
|
| 20 |
+
btn.click(fn=wrapper_fn, outputs=out)
|
| 21 |
+
demo.launch()
|