LiquidAI 的 LFM2.5-VL-450M 视觉语言模型(~450M 参数),适配到昇腾 910 NPU(torch-npu 2.9.0)推理。
Lfm2VlForConditionalGeneration 架构(transformers 原生支持,无需 trust_remote_code)inference.py 双模式:CLI 单图推理 + FastAPI POST /predict./model_weights/LFM2.5-VL-450Mpip install -r requirements.txt -i https://repo.huaweicloud.com/repository/pypi/simple/python inference.py --img test.png --max-new-tokens 64uvicorn inference:app --host 0.0.0.0 --port 8000
curl -F "file=@test.png" http://127.0.0.1:8000/predict| 项目 | 结果 |
|---|---|
| 设备 | npu:0(Ascend 910,CANN 8.5.1) |
| CLI | 推理成功,输出结构化 JSON |
| FastAPI | /predict 返回推理 JSON |
| 截图 | assets/agent_workflow.png、assets/npu_device_call.png、assets/model_result.png |