SimVLA (LIBERO Edition) — Vision-Language-Action (VLA) 策略模型,昇腾 NPU 适配推理工程。
YuankaiLuo/SimVLA-LIBERO(HuggingFace 权重镜像)LUOyk1999/SimVLA(GitHub)libero_joint(8 维 proprio → 7 维动作,num_actions=10)npu:0),框架 PyTorch + torch_npunpu:0。import torch_npu + torch.npu.set_device(0),失败时抛异常退出(不做 CPU/CUDA 回退)。smolvlm_base/(idefics3 config + processor)经
AutoModelForImageTextToText.from_config 构建骨架,完整权重由 checkpoint(model.safetensors)加载,
无需联网下载 1GB 基础模型。POST /predict 服务。configuration/modeling/processing_smolvlm_vla.py、action_hub.py、
transformer_smolvlm.py 来自官方源码仓库,一并缓存于权重目录。# 环境
export ASCEND_VISIBLE_DEVICES=14
# 安装依赖
pip install -r requirements.txt
# CLI 单图推理(自动下载/复用权重)
python inference.py --img test_input.png
# 自定义语言指令
python inference.py --img test_input.png --instruction "pick up the red block and place it in the bowl"
# FastAPI 服务
python inference.py --serve --port 8000
curl -F "file=@test_input.png" -F "instruction=pick up the red block and place it in the bowl" http://127.0.0.1:8000/predict权重缓存于 ./model_weights/YuankaiLuo/SimVLA-LIBERO/(模型全名),已缓存则直接复用([cache-hit]),
避免重复下载。缺失文件自动从 https://hf-mirror.com 补全。
返回 action_trajectory JSON:形状 [1, 10, 7] 的动作轨迹(delta_xyz(3) + delta_euler(3) + gripper_cmd(1)),
含均值/标准差/最值等统计。
assets/agent_workflow.png:NPU 环境检查 / 依赖安装 / 任务启动总日志assets/npu_device_call.png:python inference.py --img test_input.png 成功输出assets/model_result.png:FastAPI curl -F 返回的推理结果 JSONApache-2.0(与上游模型一致)