本仓库为 IffYuan/Embodied-R1.5
(基于 Qwen3-VL-8B-Instruct 微调的统一具身基础模型)的 昇腾 NPU (Ascend910 / torch-npu)
适配版本。已完整清除 CUDA 依赖,模型与输入张量全部迁移至 npu:0 运行。
Qwen3VLForConditionalGeneration (qwen3_vl)<answer>(点、框、深度等 embodied 推理结果)python inference.py --img test_input.png
# 可选自定义任务提示词:
python inference.py --img test_input.png --prompt "你的 embodied 任务描述"uvicorn inference:app --host 0.0.0.0 --port 8000
curl -F "file=@test_input.png" http://127.0.0.1:8000/predict返回结构化 JSON,含 response(完整回复)与 answer(<answer> 标签内容)。
import torch_npu + torch.npu.set_device(0),并用 try-except 捕获
NPU 初始化异常。.cuda()、torch.cuda.*、device="cuda")。torch_dtype=torch.bfloat16 加载(Ascend910 原生支持 bf16),
attn_implementation="eager" 规避 NPU 上 sdpa/flash-attn 潜在兼容问题。model_weights/IffYuan/Embodied-R1.5(本仓库不包含大权重,按需下载)。