Commit 5dd56e0a authored by zzg_666's avatar zzg_666
Browse files

升级到dtk25.04.2

parent 3b64d3e2
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
...@@ -2,7 +2,7 @@ from PIL import Image ...@@ -2,7 +2,7 @@ from PIL import Image
import torch import torch
from transformers import AutoModelForCausalLM, AutoProcessor from transformers import AutoModelForCausalLM, AutoProcessor
model_path = "moonshotai/Kimi-VL-A3B-Instruct" model_path = "../moonshotai/Kimi-VL-A3B-Instruct"
model = AutoModelForCausalLM.from_pretrained( model = AutoModelForCausalLM.from_pretrained(
model_path, model_path,
torch_dtype=torch.bfloat16, torch_dtype=torch.bfloat16,
...@@ -11,7 +11,7 @@ model = AutoModelForCausalLM.from_pretrained( ...@@ -11,7 +11,7 @@ model = AutoModelForCausalLM.from_pretrained(
) )
processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True) processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
image_path = "/XXX/XXX.jpg" image_path = "./xx.png"
image = Image.open(image_path) image = Image.open(image_path)
messages = [ messages = [
{"role": "user", "content": [{"type": "image", "image": image_path}, {"type": "text", "text": "Ocr this image."}]} {"role": "user", "content": [{"type": "image", "image": image_path}, {"type": "text", "text": "Ocr this image."}]}
......
...@@ -24,7 +24,7 @@ ViT是Google团队提出的将Transformer应用在图像分类的模型。ViT将 ...@@ -24,7 +24,7 @@ ViT是Google团队提出的将Transformer应用在图像分类的模型。ViT将
### 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-dtk24.04.3-ubuntu20.04 docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.5.1-ubuntu22.04-dtk25.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 kimi-vl <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 --network=host --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name kimi-vl <your IMAGE ID> bash # <your IMAGE ID>为以上拉取的docker的镜像ID替换
...@@ -56,10 +56,10 @@ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple ...@@ -56,10 +56,10 @@ 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驱动:dtk24.04.3 DTK驱动:dtk25.04.2
python:3.10 python:3.10
torch:2.3.0 torch:2.5.1
transformers>=4.48.0 transformers==4.48.2
``` ```
`Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应` `Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment