约 4.5 亿参数的轻量视觉语言模型,支持图片描述、视觉问答和多语言视觉理解。 本仓库使用 torch_npu 在昇腾 910B4-1 上完成真实端到端推理,禁止 CPU 静默回退。
otherimage-text-to-textLfm2VlProcessor)npu:2https://mirrors.aliyun.com/pypi/simple/安装上层依赖:
python3 -m venv --system-site-packages .venv
source .venv/bin/activate
export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
export PIP_TRUSTED_HOST=mirrors.aliyun.com
pip install -r requirements.txtmodel/,或用 MODEL_DIR/--model-dir 指向该固定版本。source /usr/local/Ascend/ascend-toolkit/set_env.sh。python inference.py --device npu:2 --max-new-tokens 64脚本会校验 NPU 可用性和张量/模型放置,失败时返回非零退出码。结构化结果写入 logs/npu_result.json。
fc6221ca597f3315e4f82fc2df606783267b34ba74f323cc3cbae9b0f23835204e69c93ca1cf0eb79b6a6aa410d777e5dfabe7f4python inference.py --device npu:2 --max-new-tokens 64input_device=npu:2, model_device=npu:2, output_device=npu:2, first_param_device=npu:2generation_seconds=6.8949, total_seconds=91.11050The image shows a simple, cartoon-style illustration of a house. It's a flat, two-dimensional design with a light blue sky, a green ground, and a brown house with a red roof. The house has a single door and a triangular roof, giving it a basic, child-like appearance. The overall style is完整输出、模型权重大小/SHA256、输入形状与版本信息见 logs/npu_result.json 和 logs/npu_inference.log。



requirements.txt 只声明上层依赖,torch/torch_npu 使用 CANN 容器内匹配版本。以下截图是本次适配保存的 ModelAgent 流式会话记录的只读回放,已脱敏;截图中的模型、设备、服务端环境、命令、问题定位和验收结论均来自本次真实会话记录 modelagent_runner_turn2.log。
