赛事: 昇腾 Model Agent 模型适配大赛(第二季) 引擎: torch_npu + transformers 硬件: Ascend 310P / 910B 标签:
npuascendpytorchroboticsvision-language-action
X-VLA 0.9B(Foundation Edition)是基于软提示(Soft Prompt)的跨具身 Vision-Language-Action(VLA)模型,采用 Flow-Matching 动作生成框架。 架构为 Florence-2 视觉语言骨干 + SoftPromptedTransformer 时间/动作头, 通过领域专属可学习嵌入实现跨机器人平台的高效适应(arXiv 2510.10274)。
| 属性 | 值 |
|---|---|
| 原始模型 | https://huggingface.co/2toINF/X-VLA-Pt |
| 参数量 | 0.9 B |
| 任务类型 | 机器人视觉-语言-动作(VLA) |
| 输入格式 | 观测图像 + 语言指令 + 域 ID + proprio |
| 输出格式 | 动作序列(流匹配迭代去噪,shape [B, 30, 20]) |
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/2toINF/X-VLA-Pt.git ./X-VLA-Pt
# 2. 运行 NPU 推理
python3 inference.py --model_path ./X-VLA-Pt \
--image obs.png --instruction "Move the object to the target." \
--domain_id 0 --steps 5 --device npu:0 --output inference_result.jsonpython3 inference.py --model_path ./X-VLA-Pt \
--image test_obs.png --instruction "Move the object to the target." \
--domain_id 0 --steps 5 --device npu:0 --output inference_result.json预期输出:
[Model Agent] ✅ NPU 设备就绪: Ascend310P3
[Model Agent] ✅ 模型加载完成 → npu:0
[Model Agent] ✅ 动作生成完成: 形状 (1, 30, 20), 推理耗时 162.190s
[Model Agent] ✅ 结果已保存 → inference_result.json推理结果摘要:
{
"model": "2toINF/X-VLA-Pt",
"engine": "torch_npu",
"device": "npu:0",
"instruction": "Move the object to the target.",
"denoising_steps": 5,
"action_shape": [1, 30, 20],
"inference_time_s": 162.19
}.
├── inference.py # NPU 推理脚本
├── readme.md # 本文件
├── requirements.txt # 依赖清单
└── assets/ # 截图素材本模型由 昇腾 Model Agent 自动完成 NPU 适配:
F.scaled_dot_product_attention,
全局替换为手动 matmul 实现(覆盖 Florence-2 与 SoftPromptedTransformer)_supports_sdpa 属性改为类属性index_fill/index_copy