Update app.py
Browse files
app.py
CHANGED
|
@@ -551,29 +551,28 @@ def generate_video(
|
|
| 551 |
video_chunks_number = get_video_chunks_number(num_frames, tiling_config)
|
| 552 |
|
| 553 |
log_memory("before pipeline call")
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
|
|
|
| 567 |
except Exception as e:
|
| 568 |
-
# If this looks like a CUDA / Triton / worker GPU init error, handle gracefully.
|
| 569 |
msg = str(e).lower()
|
|
|
|
| 570 |
if "no cuda" in msg or "cuda error" in msg or "triton" in msg or "no cuda-capable" in msg:
|
| 571 |
print(f"[ERROR] GPU initialization failed during pipeline call: {type(e).__name__}: {e}")
|
| 572 |
print("[ERROR] This environment reports CUDA availability but failed to initialize a GPU.")
|
| 573 |
-
print("[SUGGESTION] Try running the Space on a GPU-enabled runner, or ensure CUDA drivers are installed.")
|
| 574 |
-
# return None (failure) and the seed so the UI doesn't hang.
|
| 575 |
return None, current_seed
|
| 576 |
-
|
| 577 |
raise
|
| 578 |
|
| 579 |
log_memory("after pipeline call")
|
|
|
|
| 551 |
video_chunks_number = get_video_chunks_number(num_frames, tiling_config)
|
| 552 |
|
| 553 |
log_memory("before pipeline call")
|
| 554 |
+
|
| 555 |
+
try:
|
| 556 |
+
video, audio = pipeline(
|
| 557 |
+
prompt=prompt,
|
| 558 |
+
seed=current_seed,
|
| 559 |
+
height=int(height),
|
| 560 |
+
width=int(width),
|
| 561 |
+
num_frames=num_frames,
|
| 562 |
+
frame_rate=frame_rate,
|
| 563 |
+
images=images,
|
| 564 |
+
audio_path=input_audio,
|
| 565 |
+
tiling_config=tiling_config,
|
| 566 |
+
enhance_prompt=enhance_prompt,
|
| 567 |
+
)
|
| 568 |
except Exception as e:
|
|
|
|
| 569 |
msg = str(e).lower()
|
| 570 |
+
|
| 571 |
if "no cuda" in msg or "cuda error" in msg or "triton" in msg or "no cuda-capable" in msg:
|
| 572 |
print(f"[ERROR] GPU initialization failed during pipeline call: {type(e).__name__}: {e}")
|
| 573 |
print("[ERROR] This environment reports CUDA availability but failed to initialize a GPU.")
|
|
|
|
|
|
|
| 574 |
return None, current_seed
|
| 575 |
+
|
| 576 |
raise
|
| 577 |
|
| 578 |
log_memory("after pipeline call")
|