MinerU 安装 (用于PDF解析,以构建大模型的知识库基础)

1. 基础环境

本次实验采用的是AutoDL,具体版本信息如图所示

2. 基于源码安装MinerU

conda create -n mineru python=3.10 -y
conda activate mineru
pip install uv -i https://mirrors.aliyun.com/pypi/simple

source /etc/network_turbo (为了访问github,开启学术加速)
git clone https://github.com/opendatalab/MinerU.git

unset http_proxy && unset https_proxy(关闭学术加速)
cd MinerU
uv pip install -e .[all] -i https://mirrors.aliyun.com/pypi/simple

3. 模型下载

执行mineru-models-download
接着会出现下载源选项包括huggingface 或者modelscope,默认为huggingface,选择其中一个即可。

程序继续执行,出现选择执行方式,包括pipline vllm all 三个选项, 默认为all,选择一个就行。

模型下载完成后在默认位置, 同时会生成一个"mineru.json" 文件在根目录。

“miru.json”文件中包括一些默认模型信息, 如果要修改模型位置的话,就更改“miru.json” 的模型的位置信息就行,换成自己需要的即可。

4. pipline尝试

export MINERU_MODEL_SOURCE =modelscope

mineru -p /root/MinerU/tests/unittest/pdfs/test.pdf -o /root/MinerU/tests/unittest/pdfs/output
mineru -p  <input_dir> -o <output_dir>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值