将 HuggingFace 模型 2toINF/X-VLA-Libero (Florence2 基座 Vision-Language-Action 机械臂策略,LIBERO 桌面操作基准)适配到华为昇腾 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-Libero权重缓存于 ./model_weights/2toINF/X-VLA-Libero/,加载时优先命中本地缓存。
python inference.py --img sample_libero.png --input "pick up the black bowl and place it on the plate"--img 缺省使用工程内 sample_libero.png(PIL 生成的厨房台面黑碗 + 盘子场景图),
--input 缺省为 "pick up the black bowl and place it on the plate"。可选 --steps 10、--domain_id 0。
python inference.py --serve --host 0.0.0.0 --port 8015GET / — HTML 上传页(图片 + 指令)POST /predict — multipart file + instruction,返回动作轨迹 JSONcurl -s -X POST http://127.0.0.1:8015/predict \
-F file=@sample_libero.png \
-F instruction="pick up the black bowl and place it on the plate"get_device() 优先 npu:0,异常回退 cpu。grep -rin cuda 工程 .py 零残留。Florence2PreTrainedModel._supports_sdpa/_supports_flash_attn_2
在 language_model 尚不存在时返回 False;get_output_embeddings 在 lm_head
被 XVLA wrapper 删除(encoder-only)时返回 None。.to(device) 回 NPU)。