赛事: 昇腾 Model Agent 模型适配大赛(第二季) 引擎: torch_npu + transformers(Qwen2.5-VL-7B) 硬件: Ascend 310P / 910B 标签:
npuascendpytorchroboticsvision-language-model
UnifoLM-VLM-Base(UnifoLM-VLA-0)是宇树科技推出的通用人形机器人操作 Vision-Language-Action(VLA)大模型。基于 Qwen2.5-VL-7B-Instruct 继续预训练, 深度融合文本指令与 2D/3D 空间信息,支持 12 类复杂操作任务的单策略执行。 输入机器人观测图像 + 语言指令,输出具身操作动作 token。
| 属性 | 值 |
|---|---|
| 原始模型 | https://huggingface.co/unitreerobotics/UnifoLM-VLM-Base |
| 参数量 | 7 B(Qwen2.5-VL-7B) |
| 任务类型 | 人形机器人视觉-语言-动作(VLA) |
| 输入格式 | 观测图像 + 语言指令 |
| 输出格式 | 动作 token 文本(具身操作指令) |
pip install -r requirements.txt -i https://repo.huaweicloud.com/repository/pypi/simple/⚠️ 本仓库不包含模型权重(交付件仅
inference.py/readme.md/requirements.txt/assets/), 推理前必须先从原始模型仓单独下载权重。
# 1. 下载模型权重(仓库不含权重,必须单独下载)
git clone https://gitcode.com/hf_mirrors/unitreerobotics/UnifoLM-VLM-Base.git ./UnifoLM-VLM-Base
# 2. 运行 NPU 推理
python3 inference.py --model_path ./UnifoLM-VLM-Base \
--image obs.png --instruction "Describe the scene and plan the next manipulation action." \
--device npu:0 --output inference_result.jsonpython3 inference.py --model_path ./UnifoLM-VLM-Base \
--image test_obs.png --instruction "Describe the scene and plan the next manipulation action." \
--device npu:0 --output inference_result.json预期输出:
[Model Agent] ✅ NPU 设备就绪: Ascend310P3
[Model Agent] ✅ 模型加载完成 → npu:0
[Model Agent] ✅ 生成完成, 推理耗时 2815.430s
[Model Agent] ✅ 结果已保存 → inference_result.json推理结果摘要:
{
"model": "unitreerobotics/UnifoLM-VLM-Base",
"engine": "torch_npu",
"device": "npu:0",
"instruction": "Describe the scene and plan the next manipulation action.",
"output": "Action:<bpos><ACTION_0><ACTION_255>...",
"inference_time_s": 2815.43
}.
├── inference.py # NPU 推理脚本
├── readme.md # 本文件
├── requirements.txt # 依赖清单
└── assets/ # 截图素材本模型由 昇腾 Model Agent 自动完成 NPU 适配:
F.scaled_dot_product_attention,
全局替换为手动 matmul 实现_keep_in_fp32_modules
机制会保留部分层 fp32,与 bf16 输入不匹配)