fix(xtts): more helpful error message when vocab.json not found

This commit is contained in:
Enno Hermann 2024-11-17 00:30:32 +01:00
parent e81f8d079c
commit 627bbe4150
1 changed files with 6 additions and 0 deletions

View File

@ -779,6 +779,12 @@ class Xtts(BaseTTS):
if os.path.exists(vocab_path):
self.tokenizer = VoiceBpeTokenizer(vocab_file=vocab_path)
else:
msg = (
f"`vocab.json` file not found in `{checkpoint_dir}`. Move the file there or "
"specify alternative path in `model_args.tokenizer_file` in `config.json`"
)
raise FileNotFoundError(msg)
self.init_models()