Amphion (/æmˈfaɪən/) is a toolkit for Audio, Music, and Speech Generation. Its purpose is to support reproducible research and help junior researchers and engineers get started in the field of audio, music, and speech generation research and development.
The G2P module fails to initialize due to using an unassigned variable.
How To Reproduce
Steps to reproduce the behavior:
Config/File changes: using valle model and editing phone_extractor to pypinyin
Run command: sh egs/tts/VALLE/run.sh --stage 1
See error:
Traceback (most recent call last):
File "/app/bins/tts/preprocess.py", line 244, in <module>
main()
File "/app/bins/tts/preprocess.py", line 240, in main
preprocess(cfg, args)
File "/app/bins/tts/preprocess.py", line 226, in preprocess
extract_phonme_sequences(dataset, output_path, cfg, dataset_types)
File "/app/bins/tts/preprocess.py", line 91, in extract_phonme_sequences
phone_extractor.extract_utt_phone_sequence(cfg, metadata)
File "/app/processors/phone_extractor.py", line 114, in extract_utt_phone_sequence
phone_extractor = phoneExtractor(cfg, dataset_name)
File "/app/processors/phone_extractor.py", line 44, in __init__
self.g2p_module = G2PModule(backend=cfg.preprocess.phone_extractor)
File "/app/text/g2p_module.py", line 113, in __init__
self.backend = self._initialize_backend(
File "/app/text/g2p_module.py", line 150, in _initialize_backend
punctuation_marks=punctuation_marks + self.separator.word,
AttributeError: 'G2PModule' object has no attribute 'separator'
Describe the bug
The G2P module fails to initialize due to using an unassigned variable.
How To Reproduce
Steps to reproduce the behavior:
phone_extractor
topypinyin
sh egs/tts/VALLE/run.sh --stage 1
Expected behavior
The error should not occur.
Additional context
https://github.com/open-mmlab/Amphion/blob/main/text/g2p_module.py
Variable self.separator is used in _initialize_backend() before assigned in init()
Possible Solution
Move
self.separator = separator
in front ofself.backend = self._initialize_backend(...)