ebook2audiobook: Unsupported class TTS.tts.configs.xtts_config.XttsConfig
Macos 15.2, apple silicon.
./ebook2audiobook.sh --headless --ebook ~/Downloads/Bardugo_Shesterka-voronov_1_Shesterka-voronov.498054.fb2.epub --voice ~/Downloads/audio_2024-10-05_20-02-56.wav --language rus Running in native mode Available Processor Unit: cpu …
1% Converting input to HTML… …
Output saved to /Users/daniilgusev/ebook2abook/tmp/ebook-58352b92-5656-4623-ab86-944377d787cb/__Bardugo_Shesterka-voronov_1_Shesterka-voronov.498054.fb2.epub
Loading TTS xtts model from tts_models/multilingual/multi-dataset/xtts_v2…
Traceback (most recent call last):
File “/Users/daniilgusev/ebook2abook/lib/functions.py”, line 536, in convert_chapters_to_audio
params[‘tts’] = XTTS(model_name=models[params[‘tts_model’]][session[‘fine_tuned’]][‘repo’])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/daniilgusev/ebook2abook/python_env/lib/python3.12/site-packages/TTS/api.py”, line 75, in init
self.load_tts_model_by_name(model_name, gpu)
File “/Users/daniilgusev/ebook2abook/python_env/lib/python3.12/site-packages/TTS/api.py”, line 177, in load_tts_model_by_name
self.synthesizer = Synthesizer(
^^^^^^^^^^^^
File “/Users/daniilgusev/ebook2abook/python_env/lib/python3.12/site-packages/TTS/utils/synthesizer.py”, line 109, in init
self._load_tts_from_dir(model_dir, use_cuda)
File “/Users/daniilgusev/ebook2abook/python_env/lib/python3.12/site-packages/TTS/utils/synthesizer.py”, line 164, in _load_tts_from_dir
self.tts_model.load_checkpoint(config, checkpoint_dir=model_dir, eval=True)
File “/Users/daniilgusev/ebook2abook/python_env/lib/python3.12/site-packages/TTS/tts/models/xtts.py”, line 785, in load_checkpoint
checkpoint = self.get_compatible_checkpoint_state_dict(model_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/daniilgusev/ebook2abook/python_env/lib/python3.12/site-packages/TTS/tts/models/xtts.py”, line 722, in get_compatible_checkpoint_state_dict
checkpoint = load_fsspec(model_path, map_location=torch.device(“cpu”))[“model”]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/daniilgusev/ebook2abook/python_env/lib/python3.12/site-packages/trainer/io.py”, line 83, in load_fsspec
return torch.load(f, map_location=map_location, weights_only=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/daniilgusev/ebook2abook/python_env/lib/python3.12/site-packages/torch/serialization.py”, line 1025, in load
raise pickle.UnpicklingError(UNSAFE_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 get the file from a trusted source. WeightsUnpickler error: Unsupported class TTS.tts.configs.xtts_config.XttsConfig
Caught DependencyError: 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 get the file from a trusted source. WeightsUnpickler error: Unsupported class TTS.tts.configs.xtts_config.XttsConfig
What could be the problem and how to fix it? If it is important, then I installed some modules manually when running the program via python_env/bin/pip3 install, for some reason this did not happen automatically.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (6 by maintainers)
If possible, I would ask you to specify in the readme that you need to perform “pip3 cache purge” before installing. The problem is solved and the conversion is already happening, so I am closing the issue.
Thank you very much for your time, it actually worked and at least I got torch 2.5.1. It might also have been influenced by the fact that I changed the link to the miniconda install script to install the arm64 version instead of x86_64. Incidentally, I also had to do this in an ubuntu arm64 VM. If it makes sense, I’ll file a PR later with a change to the ebook2audiobook.sh script so that the installation takes the host architecture into account in the future.