Spaces:
Paused
Paused
Update app_torch.py
Browse files- app_torch.py +5 -2
app_torch.py
CHANGED
|
@@ -14,7 +14,7 @@ import torch
|
|
| 14 |
from huggingface_hub import hf_hub_download
|
| 15 |
from PIL import Image
|
| 16 |
import spaces
|
| 17 |
-
|
| 18 |
# ---------------------------
|
| 19 |
# Environment flags (reduce fusion/compilation) — set early
|
| 20 |
# ---------------------------
|
|
@@ -214,7 +214,10 @@ def generate_output(prompt, mode, duration, width, height, steps, guidance, sche
|
|
| 214 |
except Exception:
|
| 215 |
pass
|
| 216 |
|
| 217 |
-
|
|
|
|
|
|
|
|
|
|
| 218 |
|
| 219 |
if mode == "image":
|
| 220 |
pipe(prompt, time_length=0, width=width, height=height, save_path=out_name)
|
|
|
|
| 14 |
from huggingface_hub import hf_hub_download
|
| 15 |
from PIL import Image
|
| 16 |
import spaces
|
| 17 |
+
import time
|
| 18 |
# ---------------------------
|
| 19 |
# Environment flags (reduce fusion/compilation) — set early
|
| 20 |
# ---------------------------
|
|
|
|
| 214 |
except Exception:
|
| 215 |
pass
|
| 216 |
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
out_name = f"/tmp/{int(time.time())}.{'mp4' if mode == 'video' else 'png'}"
|
| 220 |
+
|
| 221 |
|
| 222 |
if mode == "image":
|
| 223 |
pipe(prompt, time_length=0, width=width, height=height, save_path=out_name)
|