XJF2332 / GOT-OCR-2-GUI

GOT-OCR的GUI版本,提供OCR、导出PDF、批处理等功能,但不提供训练功能
Apache License 2.0
118 stars 12 forks source link

请问下linux环境如何部署这个gui #3

Closed dragenxp closed 2 months ago

XJF2332 commented 2 months ago

这下知识盲区了,我甚至没用过linux😫

badarrrr commented 2 months ago

我说怎么保存为pdf一直失败😂,原来我是linux环境下的。 实践证明可以部署,把requirements里的依赖安装一下就可以(我是在服务器里跑的,cuda已经安装好了),基本的ocr是可以的,跟wkhtmltopdf有关的应该会报错 屏幕截图 2024-09-23 142509

badarrrr commented 2 months ago

或者安装wkhtmltopdf的linux版本 但我没试过 可能代码也得改)

XJF2332 commented 2 months ago

新脚本已经迁移到了edge web driver,也许你能试一下?readme有说怎么装

XJF2332 commented 2 months ago

以及存pdf要用渲染模式才行,其他模式是不能存的

badarrrr commented 2 months ago

render也可以跑通 image image

XJF2332 commented 2 months ago

这样,你看看新的脚本,导pdf已经换成了selenium和edge webdriver,重新装一下依赖再看看能不能用,如果不行的话我也没办法了,我完全不懂linux😂

badarrrr commented 2 months ago

我试了一下,在linux里面安装linux版本的wkhtmltopdf,然后把代码里wkhtmltopdf的可执行文件(wkhtmltopdf.exe)路径换成安装好后的可执行文件路径就可以用了 (๑•̀ㅂ•́)و✧

HackerTao commented 2 months ago

如果使用linux,可以执行以下代码,完成部署,未实验生成pdf的功能。

conda create -n got python=3.10 -y
conda activate got
cd /opt
git clone https://github.com/XJF2332/GOT-OCR-2-GUI.git
cd GOT-OCR-2-GUI
pip install -r requirements-noversion.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
mkdir models
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/model.safetensors
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/model.safetensors
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/config.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/modeling_GOT.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/render_tools.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/got_vision_b.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/generation_config.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/qwen.tiktoken
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/special_tokens_map.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/tokenization_qwen.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/tokenizer_config.json
cd ..
python GUI.py

完成无报错后,可以浏览器访问 http://127.0.0.1:7860/

sunshinejoesun commented 1 month ago

如果使用linux,可以执行以下代码,完成部署,未实验生成pdf的功能。

conda create -n got python=3.10 -y
conda activate got
cd /opt
git clone https://github.com/XJF2332/GOT-OCR-2-GUI.git
cd GOT-OCR-2-GUI
pip install -r requirements-noversion.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
mkdir models
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/model.safetensors
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/model.safetensors
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/config.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/modeling_GOT.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/render_tools.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/got_vision_b.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/generation_config.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/qwen.tiktoken
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/special_tokens_map.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/tokenization_qwen.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/tokenizer_config.json
cd ..
python GUI.py

完成无报错后,可以浏览器访问 http://127.0.0.1:7860/

我在执行python GUI.py时 提示RuntimeError: Directory 'static/' does not exist 这个问题要如何解决呢

XJF2332 commented 1 month ago

看一下完整报错信息

sunshinejoesun commented 1 month ago

看一下完整报错信息

微信截图_20241015214802

XJF2332 commented 1 month ago

import库失败了,应该是没安装好,我是能正常import的 image

xinhaojin commented 1 month ago

如果使用linux,可以执行以下代码,完成部署,未实验生成pdf的功能。

conda create -n got python=3.10 -y
conda activate got
cd /opt
git clone https://github.com/XJF2332/GOT-OCR-2-GUI.git
cd GOT-OCR-2-GUI
pip install -r requirements-noversion.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
mkdir models
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/model.safetensors
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/model.safetensors
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/config.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/modeling_GOT.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/render_tools.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/got_vision_b.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/generation_config.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/qwen.tiktoken
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/special_tokens_map.json
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/tokenization_qwen.py
wget -c https://hf-mirror.com/stepfun-ai/GOT-OCR2_0/resolve/main/tokenizer_config.json
cd ..
python GUI.py

完成无报错后,可以浏览器访问 http://127.0.0.1:7860/

我在执行python GUI.py时 提示RuntimeError: Directory 'static/' does not exist 这个问题要如何解决呢

我也是这个问题

XJF2332 commented 1 month ago

这样吧,你们先把这一段注释掉,报错的这一段代码其实根本用不到 image

XJF2332 commented 1 month ago

简单看了一下,网上说是有什么兼容性问题,先把fitz和pymupdf卸载了,再pip install PyMuPDF就行,不用再pip fitz了 image

sunshinejoesun commented 1 month ago

简单看了一下,网上说是有什么兼容性问题,先把fitz和pymupdf卸载了,再pip install PyMuPDF就行,不用再pip fitz了 image

按照您的方法,我成功打开了网页,但是在做测试时发现提示NoneType' object has no attribute 'chat',我尝试修改了GUI中的model和tokenizer中的路径,但并没有解决 image

XJF2332 commented 1 month ago

忘了把我测试用的配置文件改回来了😂😂😂你用Config Manager.py把load_model_on_start改成true就行了,路径不用改,这把是我的问题😂😂😂

XJF2332 commented 1 month ago

还有什么问题开新issue哈,不要总是在已经关闭的issue下提问了