文件最后提交记录最后更新时间
[Docs] Modify current repository URLs to relative paths Co-authored-by: AZe_404<wangze62@h-partners.com> # message auto-generated for no-merge-commit merge: !2360 merge chg_branch_2600 into 26.0.0 [Docs] Modify current repository URLs to relative paths Created-by: AZe_404 Commit-by: AZe_404 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 1. 拉取代码修改为拉取26.0.0分支,包括之前未指定版本的MindSpeed Core 2. 将MM仓库内的链接修改为相对路径访问 ## Does this PR introduce any user-facing change? Please describe whether the PR will result in any user-facing usage changes. If there is related documentation, please specify its path. ## How was this patch tested? Please explain how to verify the correctness and effectiveness of this feature, as well as its usage constraints and limitations. See merge request: Ascend/MindSpeed-MM!23601 个月前
!1340 [Bugfix]Security update: Remove 'trust_remote_code : true' from example code. Merge pull request !1340 from zhangxubin/master 9 个月前
!1340 [Bugfix]Security update: Remove 'trust_remote_code : true' from example code. Merge pull request !1340 from zhangxubin/master 9 个月前
[Docs] Document corrections Co-authored-by: js1234567<jiangshuo9@h-partners.com> # message auto-generated for no-merge-commit merge: !2108 merge master into master [Docs] Document corrections Created-by: js1234567 Commit-by: js1234567 Merged-by: ascend-robot Description: ## Motivation Document corrections: 1. 添加2.3.0配套信息 2. 中英文标点问题 3. 链接版本更新 4. CANN8.5.0版本配置环境变量刷新, 涉及环境变量设置需全面排查修改 ## Modification Readme.md ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [x] The new code needs to comply with the Clean Code specification. - [x] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/MindSpeed-MM!21083 个月前
README.md

JanusPro 使用指南

环境安装

【模型开发时推荐使用配套的环境版本】

请参考安装指南

1. 仓库拉取

git clone --branch 26.0.0 https://gitcode.com/Ascend/MindSpeed-MM.git
git clone https://github.com/deepseek-ai/Janus.git
cd MindSpeed-MM
mkdir ckpt
cd ..

cp -r ./Janus ./MindSpeed-MM/examples/JanusPro

2. 环境搭建

对./examples/JanusPro/Janus中的pyproject.toml文件的dependencies做如下修改:

  • torch==2.7.1
  • numpy==1.26.4
  • 增加依赖:decorator
  • 增加依赖:scipy
  • 增加依赖:attrs
# python3.10
conda create -n test python=3.10
conda activate test

# 安装 torch 和 torch_npu,注意要选择对应python版本、x86或arm的torch、torch_npu及apex包
# 下载路径参考 https://www.hiascend.com/document/detail/zh/Pytorch/60RC3/configandinstg/instg/insg_0001.html
pip install torch-2.7.1-cp310-cp310-manylinux_2_28_aarch64.whl
pip install torch_npu-2.7.1*-cp310-cp310-manylinux_2_28_aarch64.whl

# 安装JanusPro依赖库
cd MindSpeed-MM/examples/JanusPro/Janus
pip install -e .

cd ..

权重下载

1. 权重下载

从Hugging Face库下载对应的模型权重:

将下载的模型权重保存到本地的ckpt/JanusPro-7B/目录下。

图像理解

1. 准备工作

配置脚本前需要完成前置准备工作,包括:环境安装权重下载,详情可查看对应章节。

2. 配置参数

在multimodal_understanding.sh中修改需要传入的参数,model_path, image_path与question,分别表示模型权重保存位置,图片位置与针对传入图片的问题。 同时还需要修改"trust_remote_code"为true。为保证代码安全,配置trust_remote_code默认为False,用户需要设置为True,并且确保自己下载的模型和数据的安全性。

另外还需设置CANN包安装位置。

    source /usr/local/Ascend/cann/set_env.sh

3. 启动脚本

  cd ./examples/JanusPro/
  bash multimodal_understanding.sh

即可得到推理结果。

推理结果示例: 以examples/qwen2vl/demo.jpg为输入图片,question为“Describe this image”,得到的推理结果为:

  The image shows a person sitting on a sandy beach, interacting with a dog. 
  The person is wearing a checkered skirt and dark pants, and the dog, 
  which appears to be a Labrador Retriever, is sitting on its hind legs, 
  reaching out with its front paws towards the person. The sun is setting, 
  casting a warm glow over the screen.