将 HuggingFace 模型 2toINF/X-VLA-WidowX (Florence2 基座 Vision-Language-Action 机械臂策略)适配到华为昇腾 NPU(torch_npu)。
ee6d,含 xyz 位置、6D 旋转、夹爪开合)modeling_xvla.py 等)einops timm json-numpy opencv-python-headless python-multipartpython3 /opt/atomgit/adapt/_shared/download_weights.py 2toINF/X-VLA-WidowX权重缓存于 ./model_weights/2toINF/X-VLA-WidowX/,加载时优先命中本地缓存。
python inference.py --img sample_widowx.png --input "pick up the red cube"--img 缺省使用工程内 sample_widowx.png(PIL 生成的桌面红方块场景图),
--input 缺省为 "pick up the red cube"。可选 --steps 10、--domain_id 0。
python inference.py --serve --host 0.0.0.0 --port 8013GET / — HTML 上传页(图片 + 指令)POST /predict — multipart file + instruction,返回动作轨迹 JSONcurl -s -X POST http://127.0.0.1:8013/predict \
-F file=@sample_widowx.png \
-F instruction="pick up the red cube"get_device() 优先 npu:0,异常回退 cpu。grep -rin cuda 工程 .py 零残留。.to(device) 回 NPU)。