From f970a391f56ff04663faf7b18b16b0a8ad78fc05 Mon Sep 17 00:00:00 2001 From: Tom Hunn Date: Thu, 31 Oct 2024 09:25:23 +1000 Subject: [PATCH] set weights_only=True when loading pretrained model --- vocos/pretrained.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vocos/pretrained.py b/vocos/pretrained.py index a8a5935..7ddd77f 100644 --- a/vocos/pretrained.py +++ b/vocos/pretrained.py @@ -67,7 +67,7 @@ def from_pretrained(cls, repo_id: str, revision: Optional[str] = None) -> Vocos: config_path = hf_hub_download(repo_id=repo_id, filename="config.yaml", revision=revision) model_path = hf_hub_download(repo_id=repo_id, filename="pytorch_model.bin", revision=revision) model = cls.from_hparams(config_path) - state_dict = torch.load(model_path, map_location="cpu") + state_dict = torch.load(model_path, map_location="cpu", weights_only=True) if isinstance(model.feature_extractor, EncodecFeatures): encodec_parameters = { "feature_extractor.encodec." + key: value