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
Phi-4-multimodal-instruct_pytorch
Commits
fe15e17c
Commit
fe15e17c
authored
Dec 26, 2025
by
zzg_666
Browse files
update
parent
8a2bc968
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
Dockerfile
Dockerfile
+1
-1
README.md
README.md
+5
-5
phi4_text_inference.py
phi4_text_inference.py
+1
-1
phi4_vision_inference.py
phi4_vision_inference.py
+1
-1
No files found.
Dockerfile
View file @
fe15e17c
FROM
image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-py3.10-dtk24.04.3-ubuntu20.04
FROM
image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.5.1-ubuntu22.04-dtk25.04.2-py3.10
\ No newline at end of file
README.md
View file @
fe15e17c
...
@@ -26,7 +26,7 @@ Mixture-of-LoRAs(MoA)的新型参数高效调整方法,旨在为LLMs的多
...
@@ -26,7 +26,7 @@ Mixture-of-LoRAs(MoA)的新型参数高效调整方法,旨在为LLMs的多
### Docker(方法一)
### Docker(方法一)
推荐使用docker方式运行, 此处提供
[
光源
](
https://www.sourcefind.cn/#/service-details
)
拉取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 --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name phi-4 <your IMAGE ID> bash # <your IMAGE ID>为以上拉取的docker的镜像ID替换
docker run -it --shm-size=1024G -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal:/opt/hyhal --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name phi-4 <your IMAGE ID> bash # <your IMAGE ID>为以上拉取的docker的镜像ID替换
git clone http://developer.sourcefind.cn/codes/modelzoo/phi-4-multimodal-instruct_pytorch.git
git clone http://developer.sourcefind.cn/codes/modelzoo/phi-4-multimodal-instruct_pytorch.git
...
@@ -56,9 +56,9 @@ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
...
@@ -56,9 +56,9 @@ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
关于本项目DCU显卡所需的特殊深度学习库可从
[
光合
](
https://developer.sourcefind.cn/tool/
)
开发者社区下载安装。
关于本项目DCU显卡所需的特殊深度学习库可从
[
光合
](
https://developer.sourcefind.cn/tool/
)
开发者社区下载安装。
```
```
DTK驱动:dtk2
4
.04.
3
DTK驱动:dtk2
5
.04.
2
python:3.10
python:3.10
torch:2.
3.0
torch:2.
5.1
flash-attn:2.6.1
flash-attn:2.6.1
```
```
`Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应`
`Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应`
...
@@ -82,7 +82,7 @@ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
...
@@ -82,7 +82,7 @@ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
使用ms-swift框架微调
使用ms-swift框架微调
```
```
git clone https://github.com/modelscope/ms-swift
.git
git clone
-b v3.11.1
https://github.com/modelscope/ms-swift
cd ms-swift
cd ms-swift
...
@@ -166,7 +166,7 @@ python phi4_speech_inference.py
...
@@ -166,7 +166,7 @@ python phi4_speech_inference.py
### 精度
### 精度
无
DCU与GPU精度一致,推理框架:vllm。
...
...
phi4_text_inference.py
View file @
fe15e17c
...
@@ -5,7 +5,7 @@ from PIL import Image
...
@@ -5,7 +5,7 @@ from PIL import Image
import
soundfile
import
soundfile
from
transformers
import
AutoModelForCausalLM
,
AutoProcessor
,
GenerationConfig
from
transformers
import
AutoModelForCausalLM
,
AutoProcessor
,
GenerationConfig
model_path
=
'
/home/wanglch/Phi4
/Phi-4-multimodal-instruct
/
'
model_path
=
'
LLM-Research
/Phi-4-multimodal-instruct'
kwargs
=
{}
kwargs
=
{}
kwargs
[
'torch_dtype'
]
=
torch
.
bfloat16
kwargs
[
'torch_dtype'
]
=
torch
.
bfloat16
...
...
phi4_vision_inference.py
View file @
fe15e17c
...
@@ -5,7 +5,7 @@ from PIL import Image
...
@@ -5,7 +5,7 @@ from PIL import Image
import
soundfile
import
soundfile
from
transformers
import
AutoModelForCausalLM
,
AutoProcessor
,
GenerationConfig
from
transformers
import
AutoModelForCausalLM
,
AutoProcessor
,
GenerationConfig
model_path
=
'
/home/wanglch/Phi4
/Phi-4-multimodal-instruct'
model_path
=
'
LLM-Research
/Phi-4-multimodal-instruct'
kwargs
=
{}
kwargs
=
{}
kwargs
[
'torch_dtype'
]
=
torch
.
bfloat16
kwargs
[
'torch_dtype'
]
=
torch
.
bfloat16
...
...
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