What version of torch etc was used?
Hi, I'm trying to run this locally and can't cause the model can be loaded. I'm wondering can you list all the package versions you used? Like torch, etc. Thanks. I'm trying on the latest 2.5.1 version and it's not working.
/opt/conda/lib/python3.11/site-packages/torch/nn/utils/weight_norm.py:143: FutureWarning: `torch.nn.utils.weight_norm` is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`.
WeightNorm.apply(module, name, dim)
/opt/conda/lib/python3.11/site-packages/torch/nn/modules/rnn.py:123: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.2 and num_layers=1
warnings.warn(
Traceback (most recent call last):
File "/app/server.py", line 32, in <module>
kokoro_model = build_model('kokoro-v0_19.pth', device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/models.py", line 584, in build_model
for key, state_dict in torch.load(path, map_location='cpu', weights_only=True)['net'].items():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/torch/serialization.py", line 1383, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
Please file an issue with the following so that we can make `weights_only=True` compatible with your use case: WeightsUnpickler error: Unsupported operand 118
Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
The HF space loads the same model successfully, and appears to be using torch 2.4.0
. For compiling the voicepacks, torch 2.3.1
was used.
The model was trained on various different A100 instances which I do not currently have access to, so I'm not sure what the precise version of torch was used there.
Try relaxing the weights_only=True
as the error message recommends, and let me know that works. If it does, it could be worth a commit so that others don't run into this issue.
But if you have trust issues, you could instead torch.load
and torch.save
the model on Colab with your desired torch version, then download the pth to your local computer.
Hey, I found the issue. I didn't have git lfs installed so it wasn't pulling the model. I got it working now.
Is it possible to release a uk voice?
Thanks