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

ValueError: substring not found in site-packages/stanza/models/tokenize/utils.py #589

Open
ChillerDragon opened this issue Feb 19, 2024 · 1 comment

Comments

@ChillerDragon
Copy link
Contributor

ERROR:libretranslate.app:Exception on /translate [POST]
Traceback (most recent call last):
  File "/home/chiller/.local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/git/LibreTranslate/libretranslate/app.py", line 296, in func
    return f(*a, **kw)
           ^^^^^^^^^^^
  File "/home/chiller/git/LibreTranslate/libretranslate/app.py", line 646, in translate
    raise e
  File "/home/chiller/git/LibreTranslate/libretranslate/app.py", line 630, in translate
    translated_text = improve_translation_formatting(q, translator.translate(q))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/argostranslate/translate.py", line 63, in translate
    return self.hypotheses(input_text, num_hypotheses=1)[0].value
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/argostranslate/translate.py", line 296, in hypotheses
    translated_paragraph = self.underlying.hypotheses(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/argostranslate/translate.py", line 173, in hypotheses
    apply_packaged_translation(
  File "/home/chiller/.local/lib/python3.11/site-packages/argostranslate/translate.py", line 425, in apply_packaged_translation
    stanza_sbd = stanza_pipeline(input_text)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/stanza/pipeline/core.py", line 166, in __call__
    doc = self.process(doc)
          ^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/stanza/pipeline/core.py", line 160, in process
    doc = self.processors[processor_name].process(doc)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/stanza/pipeline/tokenize_processor.py", line 85, in process
    _, _, _, document = output_predictions(None, self.trainer, batches, self.vocab, None,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chiller/.local/lib/python3.11/site-packages/stanza/models/tokenize/utils.py", line 163, in output_predictions
    st0 = text.index(part, char_offset) - char_offset
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: substring not found

LibreTranslate version: 65fdbe8
stanza version: 1.1.1
argostranslate version: 1.9.1

I know my version is not the latest and the crash log is not very helpful. Just found that in my logs and decided to share it. Feel free to close it as can not reproduce because I can not either.

@argosopentech
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants