rahul7star commited on
Commit
9ba038e
·
verified ·
1 Parent(s): ba34821

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -76,6 +76,8 @@ def load_t2v_pipeline():
76
  num_frames=MAX_FRAMES_MODEL,
77
  )
78
  t2v_pipe_cache[0].enable_model_cpu_offload() # Enable CPU offload for memory optimization
 
 
79
  clear_memory()
80
  return t2v_pipe_cache[0]
81
 
@@ -181,7 +183,7 @@ def generate_video(
181
 
182
  if mode == "Text-to-Video":
183
  unload_i2v_pipeline() # Unload I2V to free memory
184
-
185
  output_frames_list = t2v_pipe(
186
  prompt=prompt,
187
  negative_prompt=negative_prompt,
 
76
  num_frames=MAX_FRAMES_MODEL,
77
  )
78
  t2v_pipe_cache[0].enable_model_cpu_offload() # Enable CPU offload for memory optimization
79
+ print(f"Pipeline memory usage: {torch.cuda.max_memory_reserved() / 1024**3:.3f} GB")
80
+
81
  clear_memory()
82
  return t2v_pipe_cache[0]
83
 
 
183
 
184
  if mode == "Text-to-Video":
185
  unload_i2v_pipeline() # Unload I2V to free memory
186
+ print(t2v_pipe.hf_device_map)
187
  output_frames_list = t2v_pipe(
188
  prompt=prompt,
189
  negative_prompt=negative_prompt,