espnet3.systems.f5tts.src.preprocessor.F5PinyinPreprocessor
Less than 1 minute
espnet3.systems.f5tts.src.preprocessor.F5PinyinPreprocessor
class espnet3.systems.f5tts.src.preprocessor.F5PinyinPreprocessor(vocab_file: str, text_name: str = 'text')
Bases: object
Tokenize text with F5’s zh+en pinyin scheme using F5’s fixed vocab.
Configure the preprocessor.
- Parameters:
- vocab_file – F5’s
vocab.txt(e.g.Emilia_ZH_EN_pinyin/vocab.txt); line number = token id, space at index 0. - text_name – Sample dict key holding the raw transcript.
- vocab_file – F5’s
Example
preprocessor:
_target_: espnet3.systems.f5tts.src.preprocessor.F5PinyinPreprocessor
vocab_file: /path/to/Emilia_ZH_EN_pinyin/vocab.txtNOTE
The vocabulary is read once at construction, so vocab_file must be the same one the checkpoint was trained with: it fixes the token ids, and a different file silently remaps them.
property vocab_size : int
Return the number of tokens in F5’s fixed vocabulary.
- Returns: Line count of
vocab_file.
NOTE
This is the value to use as the model’s idim when training against F5’s fixed vocabulary instead of an ESPnet token list.
