Skip to content

[Bug] MaxKB对接MinerU失败 #5084

@Cherzing

Description

@Cherzing

Contact Information

No response

MaxKB Version

MaxKB Pro v2.6.1

Problem Description

各位好,想请教一下 MaxKB 对接 MinerU 的兼容性问题。

环境如下:

  • MaxKB Pro v2.6.1
  • MaxKB 部署机器:10.2.197.52
  • MinerU 部署机器:华为昇腾 310P,IP 10.2.197.22
  • MinerU 当前启动了:
    • mineru-api --host 0.0.0.0 --port 8000
    • mineru-gradio --server-name 0.0.0.0 --server-port 7860 --enable-api true --api-url http://127.0.0.1:8000

在 MaxKB 的 MinerU 工具中,我配置的主要参数如下:

  • mineru_gradio_url = http://10.2.197.22:7860
  • backend_server_url = http://10.2.197.22:30000
  • office_convert_url = http://10.2.197.22:30001/forms/libreoffice/convert
  • upload_url = http://10.2.197.52:8080/admin/api/oss/file
  • url_prefix = http://10.2.197.52:8080/admin

我做过的验证:

  • 从 MinerU 服务器本机访问:
    • curl http://127.0.0.1:7860/config 正常返回 Gradio 配置
  • 从 MaxKB 服务器访问:
    • curl http://10.2.197.22:7860/config 正常返回 Gradio 配置
    • curl http://10.2.197.22:8000/docs 正常返回 FastAPI Swagger 页面
  • 在 MaxKB 容器里手工测试:
    • Client('http://10.2.197.22:7860/') 可以成功加载
    • Client('http://10.2.197.22:8000/') 会报 Could not fetch config

说明:

  • 7860 的 Gradio 服务是通的
  • 8000 是 FastAPI,也正常
  • 网络层面基本没问题

但是 MaxKB 调用工具时,最终报错是:

解析失败:Gradio OCR调用失败:Cannot find a function with api_name: /to_markdown.

7860/config 返回内容里看到,当前 MinerU Gradio 暴露的公开接口是:

  • convert_to_markdown_stream

并没有:

  • /to_markdown

所以我现在怀疑是:

  • MaxKB 当前这个 MinerU 工具是按旧版 MinerU Gradio API 写的,内部写死调用 /to_markdown
  • 而我部署的是新版 MinerU 2.7,Gradio 接口已经变更
  • 导致工具和 MinerU 版本不兼容

想请教大家几个问题:

  1. MaxKB 当前内置/工具市场里的 MinerU 工具,官方推荐兼容的是哪个 MinerU 版本?
  2. 这个工具是否确实依赖旧版 Gradio 接口 /to_markdown
  3. 如果要适配 MinerU 2.7,是否应该改为调用新版接口 convert_to_markdown_stream
  4. 还是说官方更推荐不要走 Gradio,而是直接对接 MinerU FastAPI 8000/file_parse 接口?
  5. 有没有已经跑通 “MaxKB + MinerU 2.x/2.7 + Ascend 310P” 的同学,能提供一份可用配置或版本组合?

目前我的初步判断是“不是网络问题,而是 MaxKB MinerU 工具与 MinerU 2.7 的 Gradio API 不兼容”。如果有官方建议的兼容版本或正确接法,麻烦指点一下,非常感谢。

Image

Steps to Reproduce

在昇腾计算卡上部署MinerU 2.7,对接失败

The expected correct result

No response

Related log output

Additional Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions