huggingface / parler-tts

Inference and training library for high-quality TTS models.
Apache License 2.0
4.57k stars 461 forks source link

Trouble pronouncing dates #33

Open Kredithaichen opened 6 months ago

Kredithaichen commented 6 months ago

I found that the model (here: the Jenny model, but I found the same issue with ParlerTTS mini) seems to have trouble pronouncing years and numbers. For example:

"The Crusaders marched through Eastern Europe, gathering support and supplies along the way, before reaching Constantinople in 1097."

https://github.com/huggingface/parler-tts/assets/31171070/a7f4c014-c8f0-4b07-b238-dd68d386bcaa

ylacombe commented 6 months ago

Hey @Kredithaichen, I'll add this to the README soon, but I just pushed a PR in the demo that shows how to correct number issues using a prompt normalizer: https://huggingface.co/spaces/parler-tts/parler_tts_mini/commit/a07119c35ecef98bd7c016b86ff71dfdc102d8b2

Let me know if it helps!

Kredithaichen commented 6 months ago

@ylacombe Thanks for the swift response! Your changes fixed the issue for numbers in general, such that they are now clearly understandable. The model does not, however, recognize it as a year, so if I prompt:

"The Crusaders marched through Eastern Europe, gathering support and supplies along the way, before reaching Constantinople in 1397."

It says 'One-thousand three-hundred ninety-seven', rather than 'thirteen-hundred ninety-seven'. Do you happen to know of any library that could fix this or would I need to replace to replace the number outright with text in a 'historic date' style?

atulpokharel001 commented 6 months ago

@Kredithaichen just use the number to text conversion $ pip install inflect

import inflect p = inflect.engine() p.number_to_words(1234567) 'one million, two hundred and thirty-four thousand, five hundred and sixty-seven'

platform-kit commented 6 months ago

@atulpokharel001 wouldn't that make the year '1984' into 'one thousand nine hundred and eighty four'?