mirror of
https://github.com/THUDM/CogVideo.git
synced 2025-04-06 03:57:56 +08:00
Merge pull request #210 from rodjjo/patch-1
Remove to device to avoid memory allocation errors
This commit is contained in:
commit
7ddd59a811
@ -19,9 +19,8 @@ from openai import OpenAI
|
|||||||
import moviepy.editor as mp
|
import moviepy.editor as mp
|
||||||
|
|
||||||
dtype = torch.bfloat16
|
dtype = torch.bfloat16
|
||||||
device = "cuda" # Need to use cuda
|
|
||||||
|
|
||||||
pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=dtype).to(device)
|
pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=dtype)
|
||||||
pipe.enable_model_cpu_offload()
|
pipe.enable_model_cpu_offload()
|
||||||
pipe.enable_sequential_cpu_offload()
|
pipe.enable_sequential_cpu_offload()
|
||||||
pipe.vae.enable_slicing()
|
pipe.vae.enable_slicing()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user