From 627bbe4150a92f7aa29d82785ed82ca34433578b Mon Sep 17 00:00:00 2001 From: Enno Hermann Date: Sun, 17 Nov 2024 00:30:32 +0100 Subject: [PATCH] fix(xtts): more helpful error message when vocab.json not found --- TTS/tts/models/xtts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TTS/tts/models/xtts.py b/TTS/tts/models/xtts.py index 7c4a76ad..22d2720e 100644 --- a/TTS/tts/models/xtts.py +++ b/TTS/tts/models/xtts.py @@ -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()