gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

[Bug]: RuntimeError: Nougat解析论文失败。

Open ipc-robot opened this issue 1 year ago • 1 comments

Installation Method | 安装方法与平台

Anaconda (I used latest requirements.txt)

Version | 版本

Latest | 最新版

OS | 操作系统

Windows

Describe the bug | 简述

Traceback (most recent call last):
  File ".\toolbox.py", line 221, in decorated
    yield from f(main_input, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, *args, **kwargs)
  File ".\crazy_functions\批量翻译PDF文档_NOUGAT.py", line 93, in 批量翻译PDF文档
    yield from 解析PDF_基于NOUGAT(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt)
  File ".\crazy_functions\批量翻译PDF文档_NOUGAT.py", line 111, in 解析PDF_基于NOUGAT
    fpp = yield from nougat_handle.NOUGAT_parse_pdf(fp, chatbot, history)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".\crazy_functions\crazy_utils.py", line 612, in NOUGAT_parse_pdf
    raise RuntimeError("Nougat解析论文失败。")
RuntimeError: Nougat解析论文失败。

Screen Shot | 有帮助的截图

image image

Terminal Traceback & Material to Help Reproduce Bugs | 终端traceback(如有) + 帮助我们复现的测试材料样本(如有)

C:\Users\23243\anaconda3\envs\academic\Lib\site-packages\torch\functional.py:512: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:3588.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
  0%|                                                                                                                               | 0/17 [02:44<?, ?it/s]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\23243\anaconda3\envs\academic\Scripts\nougat.exe\__main__.py", line 7, in <module>
  File "C:\Users\23243\anaconda3\envs\academic\Lib\site-packages\predict.py", line 167, in main
    model_output = model.inference(
                   ^^^^^^^^^^^^^^^^
  File "C:\Users\23243\anaconda3\envs\academic\Lib\site-packages\nougat\model.py", line 592, in inference
    decoder_output = self.decoder.model.generate(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\23243\anaconda3\envs\academic\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\23243\anaconda3\envs\academic\Lib\site-packages\transformers\generation\utils.py", line 1914, in generate
    result = self._sample(
             ^^^^^^^^^^^^^
  File "C:\Users\23243\anaconda3\envs\academic\Lib\site-packages\transformers\generation\utils.py", line 2648, in _sample
    model_inputs = self.prepare_inputs_for_generation(input_ids, **model_kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BARTDecoder.prepare_inputs_for_inference() got an unexpected keyword argument 'cache_position'
-> Cannot close object, library is destroyed. This may cause a memory leak!

ipc-robot avatar Jul 10 '24 03:07 ipc-robot

WARNING:root:No GPU found. Conversion on CPU is very slow.
C:\Users\23243\anaconda3\envs\academic\Lib\site-packages\torch\functional.py:512: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:3588.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
  0%|                                                                                                                               | 0/17 [00:00<?, ?it/s]

ipc-robot avatar Jul 10 '24 06:07 ipc-robot