gcw_mXoV1I2Z/LFM2.5-VL-450M
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

LFM2.5-VL-450M (昇腾 NPU 适配)

LiquidAI 的 LFM2.5-VL-450M 视觉语言模型(~450M 参数),适配到昇腾 910 NPU(torch-npu 2.9.0)推理。

特性

  • 基于 Lfm2VlForConditionalGeneration 架构(transformers 原生支持,无需 trust_remote_code)
  • 多模态对话:SigLIP2 视觉塔 + LFM2.5 文本模型
  • inference.py 双模式:CLI 单图推理 + FastAPI POST /predict
  • 权重缓存:./model_weights/LFM2.5-VL-450M

依赖

pip install -r requirements.txt -i https://repo.huaweicloud.com/repository/pypi/simple/

CLI 推理

python inference.py --img test.png --max-new-tokens 64

FastAPI 服务

uvicorn 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