mirror of
https://github.com/rhasspy/piper-sample-generator.git
synced 2026-08-27 18:15:58 -04:00
fix: PyTorch 2.6 compatibility in piper-sample-generator
Fix torch.load compatibility with PyTorch 2.6 Add weights_only=False parameter to torch.load() call in generate_samples.py to maintain compatibility with PyTorch 2.6, which changed the default value of weights_only from False to True. This allows loading models with custom classes like piper_train.vits.models.SynthesizerTrn. Fixes model loading error: "Weights only load failed" when using PyTorch 2.6+
This commit is contained in:
parent
9c1019c932
commit
fe411ccb2b
1 changed files with 1 additions and 1 deletions
|
|
@ -73,7 +73,7 @@ def generate_samples(
|
|||
_LOGGER.debug("Loading %s", model)
|
||||
model_path = Path(model)
|
||||
|
||||
torch_model = torch.load(model_path)
|
||||
torch_model = torch.load(model_path, weights_only=False)
|
||||
torch_model.eval()
|
||||
_LOGGER.info("Successfully loaded the model")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue