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

AttributeError: 'Num2Word_IT' object has no attribute 'to_year' #38

Open
grigio opened this issue Mar 28, 2023 · 1 comment
Open

AttributeError: 'Num2Word_IT' object has no attribute 'to_year' #38

grigio opened this issue Mar 28, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@grigio
Copy link

grigio commented Mar 28, 2023

Describe the bug
Mimic3 works on Docker with italian voices but it seems to crash with years

To Reproduce
Steps to reproduce the behavior:

  • type: "Fino a quando, dopo quattro anni di relazione, dal 2016 al 2020, e un anno di convivenza, la donna aveva scoperto per caso la malattia del compagno."
  • pick Italian

Expected behavior
it should read

Log files

ERROR:mimic3_http.app:'Num2Word_IT' object has no attribute 'to_year'
Traceback (most recent call last):
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/quart/app.py", line 1673, in full_dispatch_request
    result = await self.dispatch_request(request_context)
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/quart/app.py", line 1718, in dispatch_request
    return await self.ensure_async(handler)(**request_.view_args)
  File "/home/mimic3/app/mimic3_http/app.py", line 215, in app_tts
    wav_bytes = await text_to_wav(
  File "/home/mimic3/app/mimic3_http/app.py", line 103, in text_to_wav
    wav_bytes = await future
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 125, in do_synthesis_proc
    result = do_synthesis(item, mimic3)
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 81, in do_synthesis
    raise e
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 61, in do_synthesis
    mimic3.speak_text(params.text, text_language=params.text_language)
  File "/home/mimic3/app/mimic3_tts/tts.py", line 380, in speak_text
    for sent_phonemes, break_type in voice.text_to_phonemes(
  File "/home/mimic3/app/mimic3_tts/voice.py", line 420, in text_to_phonemes
    for sentence in gruut.sentences(text, lang=text_language):
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/gruut/__init__.py", line 79, in sentences
    graph, root = text_processor(text, lang=lang, ssml=ssml, **process_args)
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/gruut/text_processor.py", line 441, in __call__
    return self.process(*args, **kwargs)
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/gruut/text_processor.py", line 1079, in process
    if pipeline_transform(self._verbalize_number, graph, root):
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/gruut/utils.py", line 351, in pipeline_transform
    if transform_func(graph, leaf_node):
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/gruut/text_processor.py", line 2146, in _verbalize_number
    num_str = num2words(final_num, **num2words_kwargs)
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/num2words/__init__.py", line 96, in num2words
    return getattr(converter, "to_{}".format(to))(number, **kwargs)
AttributeError: 'Num2Word_IT' object has no attribute 'to_year'

@grigio grigio added the bug Something isn't working label Mar 28, 2023
@synesthesiam
Copy link
Collaborator

The num2words package must not support years in Italian. I'd suggest looking in to Piper which uses espeak-ng under the hood instead.

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