TTS
TTS copied to clipboard
error in --list_speaker_idxs
Hello. I've installed tts via pip
tts --list_speaker_idxs generates the following error:
> Available speaker ids: (Set --speaker_idx flag to one of these values to use the multi-speaker model.
Traceback (most recent call last):
File "/home/user/.local/bin/tts", line 8, in <module>
sys.exit(main())
File "/home/user/.local/lib/python3.10/site-packages/TTS/bin/synthesize.py", line 333, in main
print(synthesizer.tts_model.speaker_manager.name_to_id)
AttributeError: 'NoneType' object has no attribute 'name_to_id'
If you are using a single-speaker model, a single-speaker model doesn't support speaker indexes, if you switch to any multispeaker model the command should work just fine! example:
tts --model_name tts_models/multilingual/multi-dataset/your_tts --list_speaker_idxs
Also when you install it via pip you get the https://github.com/coqui-ai/TTS maintained by the Coqui team and has more recent updates.
I was doing
script = 'hello this is the test audio.'
wav, alignment, _, _ = synthesis(model, script, C, "cuda" in str(next(model.parameters()).device), speaker_id=None, d_vector=target_emb, language_id=0).values()
and the error was
AttributeError: 'NoneType' object has no attribute 'name_to_id'
I have resolved that by setting language_id=None the final command will be
wav, alignment, _, _ = synthesis(model, script, C, "cuda" in str(next(model.parameters()).device), speaker_id=None, d_vector=target_emb, language_id=None).values()