diff --git a/wan/modules/clip.py b/wan/modules/clip.py index 42dda04..7bf859d 100644 --- a/wan/modules/clip.py +++ b/wan/modules/clip.py @@ -516,7 +516,7 @@ class CLIPModel: self.model = self.model.eval().requires_grad_(False) logging.info(f'loading {checkpoint_path}') self.model.load_state_dict( - torch.load(checkpoint_path, map_location='cpu')) + torch.load(checkpoint_path, map_location='cpu', weights_only=True)) # init tokenizer self.tokenizer = HuggingfaceTokenizer( diff --git a/wan/modules/t5.py b/wan/modules/t5.py index c841b04..021f1c7 100644 --- a/wan/modules/t5.py +++ b/wan/modules/t5.py @@ -493,7 +493,7 @@ class T5EncoderModel: dtype=dtype, device=device).eval().requires_grad_(False) logging.info(f'loading {checkpoint_path}') - model.load_state_dict(torch.load(checkpoint_path, map_location='cpu')) + model.load_state_dict(torch.load(checkpoint_path, map_location='cpu', weights_only=True)) self.model = model if shard_fn is not None: self.model = shard_fn(self.model, sync_module_states=False) diff --git a/wan/modules/vae.py b/wan/modules/vae.py index 5c6da57..f7bb78a 100644 --- a/wan/modules/vae.py +++ b/wan/modules/vae.py @@ -611,7 +611,7 @@ def _video_vae(pretrained_path=None, z_dim=None, device='cpu', **kwargs): # load checkpoint logging.info(f'loading {pretrained_path}') model.load_state_dict( - torch.load(pretrained_path, map_location=device), assign=True) + torch.load(pretrained_path, map_location=device, weights_only=True), assign=True) return model