Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
MiniCPM-V-2_6_pytorch
Commits
4636f30a
Commit
4636f30a
authored
Dec 13, 2025
by
zzg_666
Browse files
升级至dtk25.04.2
parent
c22e754b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
9 deletions
+10
-9
Dockerfile
Dockerfile
+1
-1
README.md
README.md
+3
-3
finetune.sh
finetune.sh
+2
-2
minicpm-v_version.py
minicpm-v_version.py
+3
-3
requirements.txt
requirements.txt
+1
-0
No files found.
Dockerfile
View file @
4636f30a
FROM
image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-py3.10-dtk24.04.3-ubuntu20.04
\ No newline at end of file
FROM
image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.5.1-ubuntu22.04-dtk25.04.2-py3.10
README.md
View file @
4636f30a
...
...
@@ -25,7 +25,7 @@
### Docker(方法一)
推荐使用docker方式运行, 此处提供
[
光源
](
https://www.sourcefind.cn/#/service-details
)
拉取docker镜像的地址与使用步骤
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.
3.0-py3.10
-dtk2
4
.04.
3-ubuntu20.04
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.
5.1-ubuntu22.04
-dtk2
5
.04.
2-py3.10
docker run -it --shm-size=1024G -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal:/opt/hyhal --network=host --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name minicpm_v <your IMAGE ID> bash # <your IMAGE ID>为以上拉取的docker的镜像ID替换
git clone http://developer.sourcefind.cn/codes/modelzoo/minicpm-v-2_6_pytorch.git
...
...
@@ -55,9 +55,9 @@ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
关于本项目DCU显卡所需的特殊深度学习库可从
[
光合
](
https://developer.sourcefind.cn/tool/
)
开发者社区下载安装。
```
DTK驱动:dtk2
4
.04.
3
DTK驱动:dtk2
5
.04.
2
python:3.10
torch:2.
3.0
torch:2.
5.1
transformers==4.48.3
```
`Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应`
...
...
finetune.sh
View file @
4636f30a
CUDA_VISIBLE_DEVICES
=
0,1,2,3
\
CUDA_VISIBLE_DEVICES
=
4,5,6,7
\
swift sft
\
--model
"OpenBMB/MiniCPM-V-2_6"
\
--model
"
../
OpenBMB/MiniCPM-V-2_6"
\
--dataset
AI-ModelScope/LaTeX_OCR:human_handwrite#20000
\
--train_type
lora
\
--torch_dtype
bfloat16
\
...
...
minicpm-v_version.py
View file @
4636f30a
...
...
@@ -3,12 +3,12 @@ import torch
from
PIL
import
Image
from
modelscope
import
AutoModel
,
AutoTokenizer
model
=
AutoModel
.
from_pretrained
(
'OpenBMB/MiniCPM-V-2_6'
,
trust_remote_code
=
True
,
model
=
AutoModel
.
from_pretrained
(
'
../
OpenBMB/MiniCPM-V-2_6'
,
trust_remote_code
=
True
,
attn_implementation
=
'sdpa'
,
torch_dtype
=
torch
.
bfloat16
)
# sdpa or flash_attention_2, no eager
model
=
model
.
eval
().
cuda
()
tokenizer
=
AutoTokenizer
.
from_pretrained
(
'OpenBMB/MiniCPM-V-2_6'
,
trust_remote_code
=
True
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
'
../
OpenBMB/MiniCPM-V-2_6'
,
trust_remote_code
=
True
)
image
=
Image
.
open
(
'
xx.jp
g'
).
convert
(
'RGB'
)
image
=
Image
.
open
(
'
./icon.pn
g'
).
convert
(
'RGB'
)
question
=
'What is in the image?'
msgs
=
[{
'role'
:
'user'
,
'content'
:
[
image
,
question
]}]
...
...
requirements.txt
View file @
4636f30a
...
...
@@ -11,3 +11,4 @@ decord
moviepy
==1.0.3
modelscope
numpy
==1.26.0
soxr
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment