在昇腾910B服务上部署搭建适配PDF解析工具Mineru2.5开源项目

在昇腾910B服务上部署搭建适配PDF解析工具Mineru2.5开源项目

文章目录


一、在昇腾社区下载适用的mindie镜像并运行容器

昇腾社区

powershell 复制代码
docker run -itd \
  --shm-size=500g \
  --net=host \
  --privileged \
  --name mindie \
  --restart=always \
  --device=/dev/davinci4 \
  --device=/dev/davinci5 \
  --device=/dev/davinci_manager \
  --device=/dev/devmm_svm \
  --device=/dev/hisi_hdc \
  -v /usr/local/Ascend/driver/:/usr/local/Ascend/driver/ \
  -v /usr/local/Ascend/add-ons/:/usr/local/Ascend/add-ons/ \
  -v /usr/local/sbin/:/usr/local/sbin/ \
  -v /var/log/npu/slog/:/var/log/npu/slog \
  -v /var/log/npu/profiling/:/var/log/npu/profiling \
  -v /var/log/npu/dump/:/var/log/npu/dump \
  -v /var/log/npu/:/usr/slog \
  -v /etc/hccn.conf:/etc/hccn.conf \
  swr.cn-south-1.myhuaweicloud.com/ascendhub/mindie:2.0.RC1-800I-A2-py311-openeuler24.03-lts \
  /bin/bash

二、安装系统运行所需要的依赖

进入容器并执行

powershell 复制代码
yum install -y mesa-libGL mesa-libGL-devel libXrender libSM libXext tesseract tesseract-langpack-chi_sim

三、安装mineru所需python依赖并设置环境变量

由博主多次测试失败找到的版本号

报错列举一下

1、报错一

operator torchvision::nms does not exist

是这个torchvision和torch没有对应的结果

2、报错二

ERR00100 PTA call acl api failed

Error\]: The internal ACL of the system is incorrect. Rectify the fault based on the error information in the ascend log. EC0010: Failed to import Python module \[AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead...\]. 这个是昇腾软件栈与NumPy 2.0不兼容 ##### 3、报错三 An error happened while trying to locate the files on the Hub and we cannot find the appropriate snapshot folder for the specified revision on the local disk. Please check your internet connection and try again. 这个是必需配置本地模型:export MINERU_MODEL_SOURCE=local ##### 4、报错四 ImportError: /usr/local/lib64/python3.11/site-packages/torch_npu/lib/libtorch_npu.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv 这个是torch和torch_npu版本不匹配 [安装版本](https://gitee.com/ascend/pytorch/releases/tag/v7.1.0.2-pytorch2.5.1) ```powershell pip install torchvision==0.20.1 numpy==1.26.4 torch==2.5.1 accelerate==1.10.1 pip install torch_npu-2.5.1.post3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl ``` 环境变量设置 ```powershell export MINERU_MODEL_SOURCE=local export HF_ENDPOINT=https://hf-mirror.com ``` #### 四、部署Mineru项目 core 模块是 MinerU 的核心依赖,包含了除vllm外的所有功能模块。安装此模块可以确保 MinerU 的基本功能正常运行 ```powershell pip install mineru[core] ``` 下载模型 ```powershell mineru-models-download ``` 下载源选择modelscope NPU支持跑pipeline #### 五、运行测试 mineru-gradio --device npu --server-name 0.0.0.0 --server-port 7860 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/f2108302b0264f1c8eff4e18d0710f78.png) ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/53e257811a4744c9b6edc611a4d7d77d.png) ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/099003cad6ef4a478afc4b1037e20c65.png)

相关推荐
Java面试题总结2 天前
基于 Java 的 PDF 文本水印实现方案(iText7 示例)
java·python·pdf
傻啦嘿哟2 天前
Python操作PDF页面详解:删除指定页的完整方案
开发语言·python·pdf
m5655bj2 天前
使用 C# 修改 PDF 页面尺寸
java·pdf·c#
geovindu2 天前
python: 简单提取PDF文档内文字
开发语言·python·pdf
m0_694845572 天前
HandBrake 是什么?视频转码工具使用与服务器部署教程
服务器·前端·pdf·开源·github·音视频
yivifu3 天前
使用PyMuPdf删除PDF文档中的水印
pdf·pymupdf·去水印
ComPDFKit3 天前
ComPDF的产品升级:从工具包到PDF服务
pdf
占疏3 天前
pdf文件解析
pdf
开开心心_Every3 天前
音频视频转文字工具,离线语音识别免费
人工智能·游戏·微信·pdf·excel·语音识别·memcache
开开心心_Every3 天前
电脑网速加速工具,无线有线叠加网络
网络·游戏·微信·pdf·电脑·excel·语音识别