dagloop5 commited on
Commit
6ab2dfe
·
verified ·
1 Parent(s): 4b32720

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -17
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
- video, audio = pipeline(
556
- prompt=prompt,
557
- seed=current_seed,
558
- height=int(height),
559
- width=int(width),
560
- num_frames=num_frames,
561
- frame_rate=frame_rate,
562
- images=images,
563
- audio_path=input_audio,
564
- tiling_config=tiling_config,
565
- enhance_prompt=enhance_prompt,
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
- # Otherwise re-raise so other programming errors bubble up
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")