Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] yourTTS Python API Portuguese (and French) not working #2458

Closed
elhombrejd opened this issue Mar 26, 2023 · 3 comments
Closed

[Bug] yourTTS Python API Portuguese (and French) not working #2458

elhombrejd opened this issue Mar 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@elhombrejd
Copy link

Describe the bug

Python API for yourTTS is not working for Portuguese (and also, it seems, French). I used the exactly same example as the given one on readme.md.

It gives me a "KeyError: 'pt'"

To Reproduce

from TTS.api import TTS
tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts")
tts.tts_to_file("Olá, tudo bem?", speaker_wav="teste.wav", language="pt", file_path="output.wav")

Expected behavior

Generate output.wav with the standard given by speaker_wav.

Logs

KeyError: 'pt'

Environment

{
    "CUDA": {
        "GPU": [
            "NVIDIA GeForce RTX 3050 Laptop GPU"
        ],
        "available": true,
        "version": "11.8"
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "2.0.0+cu118",
        "TTS": "0.12.0",
        "numpy": "1.22.4"
    },
    "System": {
        "OS": "Linux",
        "architecture": [
            "64bit",
            ""
        ],
        "processor": "x86_64",
        "python": "3.10.6",
        "version": "#1 SMP Fri Apr 2 22:23:49 UTC 2021"
    }

Additional context

No response

@elhombrejd
Copy link
Author

The complete log of the error:

Text splitted to sentences.
['Olá, tudo bem?']
Traceback (most recent call last):
File "", line 1, in
File "/root/TTS/api.py", line 220, in tts_to_file
wav = self.tts(text=text, speaker=speaker, language=language, speaker_wav=speaker_wav)
File "/root/TTS/api.py", line 183, in tts
wav = self.synthesizer.tts(
File "/root/TTS/utils/synthesizer.py", line 253, in tts
language_id = self.tts_model.language_manager.name_to_id[language_name]
KeyError: 'pt'

@erogol
Copy link
Member

erogol commented Mar 27, 2023

language code is pt-br

@erogol erogol closed this as completed Mar 27, 2023
@elhombrejd
Copy link
Author

Thanks @erogol!

TCNOco added a commit to TCNOco/TTS that referenced this issue Apr 4, 2023
Running the sample code below results in an error `language_id = self.tts_model.language_manager.name_to_id[language_name]`.
The fix is running the code with the correct language strings, the readme has been updated in this PR to work.

I assume this small typo leads to coqui-ai#2456 and coqui-ai#2458
erogol pushed a commit that referenced this issue Apr 5, 2023
Running the sample code below results in an error `language_id = self.tts_model.language_manager.name_to_id[language_name]`.
The fix is running the code with the correct language strings, the readme has been updated in this PR to work.

I assume this small typo leads to #2456 and #2458
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants