open-mmlab / Amphion

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.
https://openhlt.github.io/amphion/
MIT License
4.45k stars 379 forks source link

[BUG]: Fix for AssertionError When Running FastSpeech2 Preprocessing (run.sh --stage 1) #118

Closed sakura657 closed 7 months ago

sakura657 commented 7 months ago

Describe the bug

When running the preprocessing stage of FastSpeech2 within the Amphion project, an AssertionError was encountered, stating that the Montreal Forced Aligner (MFA) tools were not found at the expected path.

How To Reproduce

Steps to reproduce the behavior:

  1. Config/File changes: cd Amphion , I run this command in the Amphion root path.
  2. Run command: sh egs/tts/FastSpeech2/run.sh --stage 1 to initiate the preprocessing stage.
  3. See error: 'AssertionError: Please download the MFA tools to Amphion/mfa/montreal-forced-aligner/bin/mfa_align firstly.'

Expected behavior

The expected behavior was that the preprocessing stage would complete without errors, provided that all the necessary tools and dependencies were correctly installed and configured.

Additional context

Upon investigating the issue, it was discovered that the AssertionError was due to a file path issue in Amphion/preprocessors/ljspeech.py at line 41, which in turn was caused by the result of os.path.exists(lexicon) returning False at line 39. The problem was traced back to line 28, where the lexicon path should be modified to lexicon=os.path.join("text", "lexicon", "librispeech-lexicon.txt"). After making this change, the preprocessing stage ran successfully.

Merakist commented 7 months ago

Thank you for this bug report! I was able to reproduce the problem you had and refactored MFA pipeline to better suit the file management convention of Amphion in PR #121. Please feel free to reopen this issue if you have any further questions!