mirror of
https://github.com/THUDM/CogVideo.git
synced 2025-04-06 03:57:56 +08:00
Remove to device to avoid memory allocation errors
Remove to(device), so it will apply the settings first
This commit is contained in:
parent
fa8c830a4e
commit
e226010ffc
@ -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