Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added tools/tool_minerU_util/1.0.6/MinerU解析pdf.tool
Binary file not shown.
16 changes: 16 additions & 0 deletions tools/tool_minerU_util/1.0.6/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## 1.0.6 版本说明

**注意**:当前适用的 MaxKB 版本为 v2.10.5-lts 及以上版本,MinerU(本地 Gradio 服务)版本为 3.4.4。

## 配置参数

需在 `/opt/maxkb/conf/maxkb.env` 中额外添加以下参数(用于关闭文件访问鉴权,使工具能正常下载/读取待解析的文件),修改后重启 maxkb 容器生效:

```bash
MAXKB_FILE_AUTH=0
```

## 注意事项

- 仅支持**离线部署**的 MinerU,且解析服务需以 Gradio 形式暴露(默认 `http://<MinerU 服务 ip>:7860/`)
- 1.0.6 起容器内**无需**再安装 `gradio_client`;若此前按 1.0.5 的文档装过,保留即可、不必卸载
Binary file added tools/tool_minerU_util/1.0.7/MinerU解析pdf.tool
Binary file not shown.
29 changes: 29 additions & 0 deletions tools/tool_minerU_util/1.0.7/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## 1.0.7 版本说明

**注意**:当前适用的 MaxKB 版本为 v2.10.5-lts 及以上版本,MinerU(本地 Gradio 服务)版本为 4.0.10。


## 配置参数

需在 `/opt/maxkb/conf/maxkb.env` 中额外添加以下参数(用于关闭文件访问鉴权,使工具能正常下载/读取待解析的文件),修改后重启 maxkb 容器生效:

```bash
MAXKB_FILE_AUTH=0
```

## 启动参数说明

| 参数名称 | 参数类型 | 参数说明 | 默认值 |
|-----------------------|----------|-------------------------------------------------------|--------------------------------------------------------|
| `mineru_gradio_url` | 字符串 | 离线 MinerU(Gradio)解析服务的访问地址:ip:web 端口号 | `http://<MinerU 服务 ip>:7860/` |
| `download_dir` | 字符串 | 存储下载原始文件与解析临时文件的目录 | `/tmp` |
| `upload_url` | 字符串 | 解析出的图片上传到的接口地址(一般上传到 MaxKB 以便引用) | `http://<MaxKB 服务器 ip>:8080/admin/api/oss/file` |
| `upload_token` | 字符串 | MaxKB 的 API Key(替换为实际值) | API Key |
| `url_prefix` | 字符串 | 拼接 `file_input` 相对路径、生成完整文件 URL 的前缀 | `http://<MaxKB 服务器 ip>:8080/admin` |
| `enable_ocr` | 开关 | 是否启用 OCR(启用则解析文件中的图片文字) | True |
| `tier` | 整数 | v4 解析档位(0~3),数字越大越精细 | 2 |
| `gradio_retry_count` | 整数 | Gradio 接口调用失败后的重试次数 | 2 |
| `img_upload_batch_size` | 整数 | 图片批量上传的并发大小 | 10 |

> 输入参数:`file_input`(数组,格式 `["文件url", ...]`),即需要解析的文件数据源。

8 changes: 5 additions & 3 deletions tools/tool_minerU_util/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ MaxKB v2.4 及以上版本,需修改配置文件 `/opt/maxkb/conf/maxkb.env`
MAXKB_SANDBOX_TMP_DIR_ENABLED=1
MAXKB_SANDBOX_PYTHON_ALLOW_SUBPROCESS=1
MAXKB_SANDBOX_PYTHON_PROCESS_LIMIT_MEM_MB=521
MAXKB_FILE_AUTH=0
```
重启 maxkb 容器
```bash
Expand All @@ -25,23 +26,24 @@ docker restart maxkb

### 安装依赖

在使用此工具之前,需要先安装所需的依赖包:
> 1.0.6 起,本工具不再依赖 `gradio_client`(改为直连 MinerU Gradio 的 HTTP API),**无需**在 MaxKB 容器内安装任何 Python 依赖包。1.0.5 及更早版本仍需按下方方式安装 `gradio_client`。

```bash
# 到 maxkb 容器内安装 gradio_client
# 1.0.5 及更早版本:到 maxkb 容器内安装 gradio_client
docker exec -it maxkb bash
pip install gradio_client

# 如果安装 gradio_client 提示 huggingface-hub 版本冲突,则使用 pip 的兼容性模式,同时安装兼容版本
pip install gradio_client huggingface-hub==0.34.0

# 授权 tmp 目录的访问操作权限
# 授权 tmp 目录的访问操作权限(各版本均需要)
chmod 777 /tmp
```

## 参数说明

### 启动参数

| 参数名称 | 参数类型 | 参数说明 | 默认值 |
|-------------------------|--------------|--------------------------------------------------|-------------------------------------------------------------|
| `enable_formula` | 开关 | 控制是否提取文件中的数学公式 | True |
Expand Down
Loading