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

Don't pass quotes to espeak #3286

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Don't pass quotes to espeak #3286

merged 1 commit into from
Nov 24, 2023

Conversation

eginhard
Copy link
Contributor

@eginhard eginhard commented Nov 22, 2023

Previously, the text was wrapped in an additional set of quotes that was passed to Espeak. This could result in different phonemization in certain edge cases (it didn't allow to pronounce A as a letter) and caused the insertion of an initial separator "_" that had to be removed. Compare:

$ espeak-ng -q -b 1 -v en-us --ipa=1 '"A"'
_ˈɐ
$ espeak-ng -q -b 1 -v en-us --ipa=1 'A'
ˈeɪ

Fixes #2619

Previously, the text was wrapped in an additional set of quotes that was passed
to Espeak. This could result in different phonemization in certain edges and
caused the insertion of an initial separator "_" that had to be removed.
Compare:
$ espeak-ng -q -b 1 -v en-us --ipa=1 '"A"'
_ˈɐ
$ espeak-ng -q -b 1 -v en-us --ipa=1 'A'
ˈeɪ

Fixes coqui-ai#2619
@erogol
Copy link
Member

erogol commented Nov 22, 2023

Do we use ' ' as passing it to espeak, otherwise we might have issues with special chars? Although I wrote the code it is alien to me now.

@eginhard
Copy link
Contributor Author

Sorry, I'm not completely sure what you mean. The actual call to Espeak is via subprocess, which would handle the quoting, e.g. like this:

subprocess.Popen(['espeak-ng', '-q', '-b', '1', '-v', 'en-us', '--ipa=1', text])

Here I changed text = '"A B C"' to text = "A B C". The extra pair of quotes were just passed as literal quote characters and have no effect on any special character processing...

@erogol
Copy link
Member

erogol commented Nov 24, 2023

ohh ok I didn't know subprocess handling the quotes. Then all should be fine.

@erogol erogol merged commit 2af0220 into coqui-ai:dev Nov 24, 2023
53 checks passed
@arbianqx
Copy link

This PR, breaks phoneme_cache computation, when initiating a new training.

@eginhard
Copy link
Contributor Author

This PR, breaks phoneme_cache computation, when initiating a new training.

@arbianqx Could you share some details about the error and training recipe/dataset/language?

@arbianqx
Copy link

Happening in albanian language, on vits recipe. Dataset is in vctk format.

@eginhard
Copy link
Contributor Author

@arbianqx What is the exact error message?

@arbianqx
Copy link

@eginhard It gets stuck at a random number, perhaps when it gets to a special char.

@eginhard
Copy link
Contributor Author

@arbianqx If you could share the error message and for which exact input it occurs that would be helpful. I phonemized some Albanian text and didn't see any obvious issues...

@arbianqx
Copy link

@eginhard I would love to share logs if any, because it just hangs there. Anyway, I'll see if I encounter this again. I'll try with a different dataset when I'll have the chance!

@eginhard eginhard deleted the fix-espeak branch March 30, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Letter-by-letter pronunciation not possible
3 participants