Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,17 @@
|
|
| 1 |
-
import os
|
|
|
|
|
|
|
| 2 |
import spaces
|
| 3 |
-
@spaces.GPU(duration=10)
|
| 4 |
def ping(): return "pong"
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
def fn(x): return f"ok:{x}"
|
| 7 |
with gr.Blocks() as demo:
|
| 8 |
-
t=
|
|
|
|
|
|
|
|
|
|
| 9 |
from fastapi import FastAPI
|
| 10 |
app = FastAPI()
|
| 11 |
app = gr.mount_gradio_app(app, demo, path="/")
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.environ.setdefault("GRADIO_USE_CDN", "true")
|
| 3 |
+
|
| 4 |
import spaces
|
| 5 |
+
@spaces.GPU(duration=10)
|
| 6 |
def ping(): return "pong"
|
| 7 |
+
|
| 8 |
import gradio as gr
|
| 9 |
def fn(x): return f"ok:{x}"
|
| 10 |
with gr.Blocks() as demo:
|
| 11 |
+
t = gr.Textbox()
|
| 12 |
+
o = gr.Textbox()
|
| 13 |
+
t.submit(fn, t, o)
|
| 14 |
+
|
| 15 |
from fastapi import FastAPI
|
| 16 |
app = FastAPI()
|
| 17 |
app = gr.mount_gradio_app(app, demo, path="/")
|