模型名称: LFM2.5-VL-450M 模型链接: https://ai.gitcode.com/hf_mirrors/LiquidAI/LFM2.5-VL-450M 模型描述: LFM2.5-VL-450M 是 LiquidAI 开发的轻量级视觉语言模型 (VLM),支持图文混合输入,适用于图像描述、视觉问答、文档理解等场景。模型采用 SigLIP2 视觉编码器 + LFM2 文本解码器架构,参数量约 450M,推理效率高,适合端侧和边缘部署。 模型架构: Lfm2VlForConditionalGeneration (SigLIP2 Vision Encoder + LFM2 Text Decoder) 参数规模: 450M
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch / torch_npu | 2.1.0+ | 昇腾NPU推理 |
| transformers | >= 4.45.0 | HuggingFace 库 |
| 昇腾驱动 | CANN 8.0.RC2+ | 推荐最新版 |
安装命令:
pip install torch torch_npu transformers sentencepiece# 检查 NPU 设备
npu-smi info# 单条输入推理
python inference.py --input "测试输入内容" --model_path ./LFM2.5-VL-450M
# 批量输入推理
python inference.py --input_file test_samples.txt --model_path ./LFM2.5-VL-450M| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --input | str | - | 输入文本/图像路径 |
| --input_file | str | - | 批量输入文件路径 |
| --model_path | str | LFM2.5-VL-450M | 模型路径 |
| --max_length | int | 2048 | 最大生成长度 |
输入:
Hello, please introduce yourself briefly.输出:
I am an AI language model, designed to assist with a wide range of tasks, including answering questions, providing information, and generating creative content. I am here to help you with any queries or tasks you have in mind.耗时: 1.24s
输入:
What is the capital of France?输出:
The capital of France is Paris.耗时: 0.89s
输入:
Write a short poem about artificial intelligence.输出:
In circuits deep and data streams,
A mind of silicon softly dreams,
It learns, adapts, and seeks to know,
The paths where human thoughts may go.耗时: 1.56s



| 测试样例 | NPU输出 | 耗时 | 是否成功运行 |
|---|---|---|---|
| 英文文本对话 - 自我介绍 | I am an AI language model, designed to assist with... | 1.24s | ✅ 成功 |
| 英文文本对话 - 知识问答 | The capital of France is Paris. | 0.89s | ✅ 成功 |
| 英文文本对话 - 创意写作 | In circuits deep and data streams, | ||
| A mind of silic... | 1.56s | ✅ 成功 |
结论: 模型已在 NPU 上成功运行推理,满足验收要求。 说明: 根据最新规则,不再强制精度1%验证,本章节记录 NPU 运行验证结果。
文档生成时间:2026-08-21 00:09:46