coqui-ai / TTS

🐸💬 - a deep learning toolkit for Text-to-Speech, battle-tested in research and production
http://coqui.ai
Mozilla Public License 2.0
35.86k stars 4.39k forks source link

[Bug] Japanese not working from CLI #3098

Closed JRMeyer closed 1 year ago

JRMeyer commented 1 year ago

Describe the bug

% TTS --model_name tts_models/multilingual/multi-dataset/xtts_v1.1 --text "こんにちは私の良き友人!" --language_idx ja --out_path "foo.wav" --speaker_wav "/Users/josh/Downloads/female-hispanola.wav"
 > tts_models/multilingual/multi-dataset/xtts_v1.1 is already downloaded.
 > Using model: xtts
 > Text: こんにちは私の良き友人!
 > Text splitted to sentences.
['こんにちは私の良き友人!']
Traceback (most recent call last):
  File "/opt/homebrew/bin/TTS", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/TTS/bin/synthesize.py", line 529, in main
    wav = synthesizer.tts(
          ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/TTS/utils/synthesizer.py", line 374, in tts
    outputs = self.tts_model.synthesize(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/TTS/tts/models/xtts.py", line 462, in synthesize
    return self.inference_with_config(text, config, ref_audio_path=speaker_wav, language=language, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/TTS/tts/models/xtts.py", line 469, in inference_with_config
    language in self.config.languages
AssertionError:  ❗ Language ja is not supported. Supported languages are ['en', 'es', 'fr', 'de', 'it', 'pt', 'pl', 'tr', 'ru', 'nl', 'cs', 'ar', 'zh-cn']

To Reproduce

$ pip list | grep TTS
TTS                       0.18.2

current version

Expected behavior

No response

Logs

No response

Environment

{
    "CUDA": {
        "GPU": [],
        "available": false,
        "version": null
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "2.0.1",
        "TTS": "0.18.2",
        "numpy": "1.24.3"
    },
    "System": {
        "OS": "Darwin",
        "architecture": [
            "64bit",
            ""
        ],
        "processor": "arm",
        "python": "3.11.4",
        "version": "Darwin Kernel Version 21.6.0: Thu Jul  6 22:20:00 PDT 2023; root:xnu-8020.240.18.702.13~1/RELEASE_ARM64_T6000"
    }
}

Additional context

No response

erogol commented 1 year ago

@Edresson can you deal with this?

Edresson commented 1 year ago

It happened because the config.languages was not updated for Japanese language. I updated the config here. If you are receiving this error, please delete the cache folder with the command rm ~/.local/share/tts/tts_models--multilingual--multi-dataset--xtts_v1.1/ -rf and run the inference command again.