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

解析复杂的出错 #1250

Open
Jandown opened this issue Dec 10, 2024 · 6 comments
Open

解析复杂的出错 #1250

Jandown opened this issue Dec 10, 2024 · 6 comments

Comments

@Jandown
Copy link

Jandown commented Dec 10, 2024

下载
gradio demo自带样例,前两个都没问题,从上图开始,后面的就无法解析,报错
Traceback (most recent call last): File "D:\Anaconda3\envs\MinerU\lib\site-packages\gradio\queueing.py", line 622, in process_events response = await route_utils.call_process_api( File "D:\Anaconda3\envs\MinerU\lib\site-packages\gradio\route_utils.py", line 323, in call_process_api output = await app.get_blocks().process_api( File "D:\Anaconda3\envs\MinerU\lib\site-packages\gradio\blocks.py", line 2014, in process_api result = await self.call_function( File "D:\Anaconda3\envs\MinerU\lib\site-packages\gradio\blocks.py", line 1567, in call_function prediction = await anyio.to_thread.run_sync( # type: ignore File "D:\Anaconda3\envs\MinerU\lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( File "D:\Anaconda3\envs\MinerU\lib\site-packages\anyio\_backends\_asyncio.py", line 2505, in run_sync_in_worker_thread return await future File "D:\Anaconda3\envs\MinerU\lib\site-packages\anyio\_backends\_asyncio.py", line 1005, in run result = context.run(func, *args) File "D:\Anaconda3\envs\MinerU\lib\site-packages\gradio\utils.py", line 846, in wrapper response = f(*args, **kwargs) File "E:\AI\MinerU-master\projects\gradio_app\app.py", line 101, in to_markdown local_md_dir, file_name = parse_pdf(file_path, './output', end_pages - 1, is_ocr, TypeError: cannot unpack non-iterable NoneType object

@myhloli
Copy link
Collaborator

myhloli commented Dec 11, 2024

看下环境里magic-pdf的版本号是多少

@Jandown
Copy link
Author

Jandown commented Dec 11, 2024

看下环境里magic-pdf的版本号是多少
0.10.5

@myhloli
Copy link
Collaborator

myhloli commented Dec 11, 2024

可以尝试降级到0.10.2再试试,目前在0.10.3~0.10.5发现一个性能bug,已经安排排期修复了

@Jandown
Copy link
Author

Jandown commented Dec 11, 2024

可以尝试降级到0.10.2再试试,目前在0.10.3~0.10.5发现一个性能bug,已经安排排期修复了

感谢解答,尝试降级0.10.2还是报错,前两个样例用doclayout_yolo模型正常,用layoutlmv3则报错,第三个开始,两个模型都是报错
File "E:\AI\MinerU\app.py", line 114, in to_markdown
local_md_dir, file_name = parse_pdf(file_path, './output', end_pages - 1, is_ocr,
TypeError: cannot unpack non-iterable NoneType object

@myhloli
Copy link
Collaborator

myhloli commented Dec 11, 2024

你看看堆栈里是不是file_path为None,如果出现这种情况,一般是上传新的pdf时,gradio没有处理完上传,也没更新file_path时就点了convert导致的,可以尝试每次新上传之前点一下clear按钮,或者上传pdf后等待PDF preview窗口可以正常渲染pdf之后再点convert按钮

@Jandown
Copy link
Author

Jandown commented Dec 11, 2024

你看看堆栈里是不是file_path为None,如果出现这种情况,一般是上传新的pdf时,gradio没有处理完上传,也没更新file_path时就点了convert导致的,可以尝试每次新上传之前点一下clear按钮,或者上传pdf后等待PDF preview窗口可以正常渲染pdf之后再点convert按钮

应该不是这个问题,我首次启动webui转换就报错了,刚试了clear,也是一样的错误。

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