experiment with compilation

#1
by multimodalart HF staff - opened
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -24,6 +24,9 @@ snapshot_download(repo_id="AlexWortega/RIFE", local_dir="model_rife")
24
  pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16).to(device)
25
  pipe.scheduler = CogVideoXDDIMScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
26
 
 
 
 
27
  os.makedirs("./output", exist_ok=True)
28
  os.makedirs("./gradio_tmp", exist_ok=True)
29
 
 
24
  pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16).to(device)
25
  pipe.scheduler = CogVideoXDDIMScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
26
 
27
+ pipe.transformer.to(memory_format=torch.channels_last)
28
+ pipe.transformer = torch.compile(pipe.transformer, mode="max-autotune", fullgraph=True)
29
+
30
  os.makedirs("./output", exist_ok=True)
31
  os.makedirs("./gradio_tmp", exist_ok=True)
32