hf_mirrors/IffYuan/Embodied-R1.5)Qwen3VLForConditionalGeneration(qwen3_vl)该模型为视觉-语言大模型(RL 微调),非轻量 CNN 类模型,因此走 vLLM-Ascend 服务化推理 路线,而不是单算子/transformers 直推路线。
| 组件 | 版本 |
|---|---|
| torch | 2.9.0 |
| torch-npu | 2.9.0.post1 |
| vllm | 0.18.0 |
| vllm-ascend | 0.18.0 |
| transformers | 4.57.6 |
| CANN | 8.5.1 |
| NPU | Ascend 910(64GB HBM × 2) |
| Python | 3.11 |
无 git-lfs 时,经 Git LFS batch API 从镜像仓库拉取(约 17.5 GB,4 个 safetensors 分片):
git clone https://atomgit.com/hf_mirrors/IffYuan/Embodied-R1.5.git /tmp/Embodied-R1.5-weights
# 进入目录后用 LFS batch API 下载 5 个 LFS 对象(4×safetensors + tokenizer.json)或使用 ModelScope:
python3 -c "from modelscope import snapshot_download; print(snapshot_download('IffYuan/Embodied-R1.5'))"pip install -r requirements.txtexport VLLM_TARGET_DEVICE=ascend
export ASCEND_VISIBLE_DEVICES=0
vllm serve /tmp/Embodied-R1.5-weights \
--served-model-name Embodied-R1.5 \
--port 8000 \
--max-model-len 16384 \
--gpu-memory-utilization 0.9 \
--trust-remote-code或直接运行仓库内脚本:
bash serve.sh # 默认 NPU:0、端口 8000部署要点:vLLM/TRITON/transformers 的缓存默认写入
$HOME/.cache。若工作目录所在文件系统存在磁盘配额(如本环境/opt/atomgit配额已满),会报Disk quota exceeded导致服务启动失败。serve.sh已通过VLLM_CACHE_ROOT、TRITON_CACHE_DIR、HF_HOME等环境变量将全部缓存重定向到/tmp。
# 文本推理(任务规划)
python3 inference.py
# 图文输入(空间指向/定位),需要真实场景图
python3 inference.py --image scene.jpg --prompt "Locate the red cup. Output the point inside <answer> tags."也可用 curl:
curl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Embodied-R1.5",
"messages": [{"role": "user", "content": [{"type": "text", "text": "Embodied 任务规划问题"}]}],
"max_tokens": 1024
}'模型按 Qwen3-VL 对话格式在 <answer>...</answer> 标签内输出结构化答案:
| 任务类型 | 答案格式(<answer> 内) |
|---|---|
| 多选 | A |
| 数值 | 3.14 |
| 开放问答 | 自由文本 |
| 数学 | $$-\dfrac{3}{2}$$ |
| 空间定位 | {"boxes": [35, 227, 437, 932]} |
| 点指向 | [{"point_2d": [230, 138]}] |
| 轨迹 | [{"point_2d": [624, 469]}, ...] |
| 3D 轨迹 | [{"point_2d": [463, 599], "depth": 1.08}, ...] |
坐标统一归一化到 [0, 1000];depth 单位为米。
vllm serve + OpenAI 兼容 API 正常服务| 测试项 | 输入 | 模型输出(<answer>) |
|---|---|---|
| 长程任务规划 | 文本:"grasp the red cup and place it on the plate, then push the apple closer" | 7 步有序计划 |
| 空间指向格式 | 文本:"Point to the red cup on the table" | [[465, 297]] |
| 图文定位(视觉编码) | 合成场景图 + "Point to the red cup" | [[471, 641]](命中杯中区域) |
| 指标 | 数值 |
|---|---|
| 平均延迟 | ~1.30 s(约 60 输出 token) |
| 生成吞吐 | ~49 tokens/s |
| HBM 占用 | ~56.7 GB / 64 GB(权重 17.5GB + KV cache + ACL 图工作区) |
| KV cache | 35.27 GiB / 256,768 tokens |
| 服务初始化 | 36.3 s(含 torch.compile + 图 warmup) |
图文输入示例见
assets/example_scene.png,可用python3 inference.py --image assets/example_scene.png --prompt "..."复现。
| 截图 | 说明 |
|---|---|
![]() | 部署/服务化推理整体流程 |
![]() | NPU 设备调用(torch_npu / ascend) |
![]() | 模型推理结果示例 |
# 1. 拉取权重(LFS batch API 或 ModelScope)
# 2. 安装依赖
pip install -r requirements.txt
# 3. 启动服务(后台)
bash serve.sh &
# 4. 客户端推理
python3 inference.py贡献者: liuhongwei-2026 | 赛道: 模型适配赛道