Spaces:
Runtime error
Runtime error
update for zerogpu
Browse files
app.py
CHANGED
|
@@ -42,6 +42,8 @@ def infer_video(path_input, seed):
|
|
| 42 |
return [g_save_path, d_save_path]
|
| 43 |
|
| 44 |
def run_demo_server():
|
|
|
|
|
|
|
| 45 |
gradio_theme = gr.themes.Default()
|
| 46 |
|
| 47 |
with gr.Blocks(
|
|
@@ -142,7 +144,7 @@ def run_demo_server():
|
|
| 142 |
)
|
| 143 |
|
| 144 |
gr.Examples(
|
| 145 |
-
fn=
|
| 146 |
examples=sorted([
|
| 147 |
[os.path.join("files", "images", name), 0]
|
| 148 |
for name in os.listdir(os.path.join("files", "images"))
|
|
@@ -188,7 +190,7 @@ def run_demo_server():
|
|
| 188 |
)
|
| 189 |
|
| 190 |
gr.Examples(
|
| 191 |
-
fn=
|
| 192 |
examples=sorted([
|
| 193 |
[os.path.join("files", "videos", name), 0]
|
| 194 |
for name in os.listdir(os.path.join("files", "videos"))
|
|
@@ -200,7 +202,7 @@ def run_demo_server():
|
|
| 200 |
|
| 201 |
### Image
|
| 202 |
image_submit_btn.click(
|
| 203 |
-
fn=
|
| 204 |
inputs=[image_input, seed],
|
| 205 |
outputs=[image_output_g, image_output_d],
|
| 206 |
concurrency_limit=1,
|
|
@@ -218,7 +220,7 @@ def run_demo_server():
|
|
| 218 |
|
| 219 |
### Video
|
| 220 |
video_submit_btn.click(
|
| 221 |
-
fn=
|
| 222 |
inputs=[input_video, seed],
|
| 223 |
outputs=[video_output_g, video_output_d],
|
| 224 |
queue=True,
|
|
|
|
| 42 |
return [g_save_path, d_save_path]
|
| 43 |
|
| 44 |
def run_demo_server():
|
| 45 |
+
infer_gpu = spaces.GPU(functools.partial(infer, seed=0))
|
| 46 |
+
infer_video_gpu = spaces.GPU(functools.partial(infer_video, seed=0))
|
| 47 |
gradio_theme = gr.themes.Default()
|
| 48 |
|
| 49 |
with gr.Blocks(
|
|
|
|
| 144 |
)
|
| 145 |
|
| 146 |
gr.Examples(
|
| 147 |
+
fn=infer_gpu,
|
| 148 |
examples=sorted([
|
| 149 |
[os.path.join("files", "images", name), 0]
|
| 150 |
for name in os.listdir(os.path.join("files", "images"))
|
|
|
|
| 190 |
)
|
| 191 |
|
| 192 |
gr.Examples(
|
| 193 |
+
fn=infer_video_gpu,
|
| 194 |
examples=sorted([
|
| 195 |
[os.path.join("files", "videos", name), 0]
|
| 196 |
for name in os.listdir(os.path.join("files", "videos"))
|
|
|
|
| 202 |
|
| 203 |
### Image
|
| 204 |
image_submit_btn.click(
|
| 205 |
+
fn=infer_gpu,
|
| 206 |
inputs=[image_input, seed],
|
| 207 |
outputs=[image_output_g, image_output_d],
|
| 208 |
concurrency_limit=1,
|
|
|
|
| 220 |
|
| 221 |
### Video
|
| 222 |
video_submit_btn.click(
|
| 223 |
+
fn=infer_video_gpu,
|
| 224 |
inputs=[input_video, seed],
|
| 225 |
outputs=[video_output_g, video_output_d],
|
| 226 |
queue=True,
|