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

Translation doesn't work. #92

Open
stemplock opened this issue Feb 2, 2024 · 2 comments
Open

Translation doesn't work. #92

stemplock opened this issue Feb 2, 2024 · 2 comments

Comments

@stemplock
Copy link

A great idea for a program, but unfortunately, despite all my efforts, I could not get it to work on Arch Linux. Neither method worked. Meanwhile, the demo version works great. Unfortunately, you cannot select the translation language there. Could you check the code or download the docker image from your working demo version? Thank you in advance. I will be looking forward to your answer.

@SUSYUSTC
Copy link
Owner

SUSYUSTC commented Feb 8, 2024

Currently the command line version allows you to select the language, but the website is still not supporting it. Additionally the current code is optimized for translation to Chinese only. Other languages should work in principle but never tested.

@stemplock
Copy link
Author

stemplock commented Feb 8, 2024

I was unable to run the command line version as well. There were errors with streams. When I set threads to 1. Parsing errors appeared. My default configuration uses Google, en, de (de-DE - tested in different formats. I don’t know how to do it correctly.) It also couldn’t be translated into Chinese. The document is loaded quite successfully, but then stops.
`

The current mathtranslate is latest
Start
engine google
language from en
language to de_DE
threads auto

arxiv number: 2304.03442

temporary directory /tmp/tmpw4zke45z
main tex files found:
./main.tex
merging ./content/introduction.tex
merging ./content/related_work.tex
merging ./content/gameworld.tex
merging ./figures/map.tex
merging ./figures/daily_routine.tex
merging ./figures/valentine.tex
merging ./figures/architecture-figure.tex
merging ./content/architecture.tex
merging ./figures/retrieval.tex
merging ./figures/reflection.tex
merging ./content/implementation.tex
merging ./content/technical_eval.tex
merging ./figures/rank_score.tex
merging ./content/designer_eval.tex
merging ./figures/info_diffusion.tex
merging ./content/discussion.tex
merging ./content/conclusion.tex
merging ./content/appendix.tex
Processing ./main
Cache is found
It is a full latex document
14%|███████▉ | 19/139 [00:20<00:04, 26.61it/s] 14%|████████▎ | 20/139 [00:30<03:01, 1.53s/it]
^CTraceback (most recent call last):
File "/home/st/PROJECT/2024/MathTranslate/venv/lib/python3.11/site-packages/mathtranslate/translate.py", line 246, in translate_full_latex
latex_translated_paragraphs = list(tqdm.auto.tqdm(executor.map(self.worker, latex_original_paragraphs), total=len(latex_original_paragraphs)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/st/PROJECT/2024/MathTranslate/venv/lib/python3.11/site-packages/tqdm/std.py", line 1182, in iter
for obj in iterable:
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 451, in result
self._condition.wait(timeout)
File "/usr/lib/python3.11/threading.py", line 327, in wait
waiter.acquire()
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/st/PROJECT/2024/MathTranslate/venv/bin/translate_arxiv", line 8, in
sys.exit(main())
^^^^^^
File "/home/st/PROJECT/2024/MathTranslate/venv/lib/python3.11/site-packages/mathtranslate/translate_arxiv.py", line 176, in main
raise e
File "/home/st/PROJECT/2024/MathTranslate/venv/lib/python3.11/site-packages/mathtranslate/translate_arxiv.py", line 166, in main
success = translate_dir('.', options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/st/PROJECT/2024/MathTranslate/venv/lib/python3.11/site-packages/mathtranslate/translate_arxiv.py", line 91, in translate_dir
translate_single_tex_file(file_path, file_path, options.engine, options.l_from, options.l_to, options.debug, options.nocache, options.threads)
File "/home/st/PROJECT/2024/MathTranslate/venv/lib/python3.11/site-packages/mathtranslate/translate.py", line 273, in translate_single_tex_file
text_final = latex_translator.translate_full_latex(text_original, nocache=nocache)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/st/PROJECT/2024/MathTranslate/venv/lib/python3.11/site-packages/mathtranslate/translate.py", line 245, in translate_full_latex
with concurrent.futures.ThreadPoolExecutor(max_workers=self.threads) as executor:
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 647, in exit
self.shutdown(wait=True)
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 235, in shutdown
t.join()
File "/usr/lib/python3.11/threading.py", line 1119, in join
self._wait_for_tstate_lock()
File "/usr/lib/python3.11/threading.py", line 1139, in _wait_for_tstate_lock
if lock.acquire(block, timeout):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt

`
Can you check this? It is very difficult to read scientific articles in English.

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

No branches or pull requests

2 participants