许可证:apache-2.0
许可证链接:https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct/blob/main/LICENSE
支持语言:
- 日语
- 英语
标签:
- vila
- nvila
- 对话式
- 多模态
基础模型:
- Qwen/Qwen2.5-1.5B-Instruct
- Efficient-Large-Model/paligemma-siglip-so400m-patch14-448
管道标签:图像文本到文本
Heron-NVILA-Lite-2B
Heron-NVILA-Lite-2B 是一款基于 NVILA-Lite 架构、专为日语训练的视觉语言模型。
模型概览
环境配置
pip install transformers==4.45.0 accelerate opencv-python torchvision einops pillow
pip install git+https://github.com/bfshi/scaling_on_scales.git
使用示例
from transformers import AutoConfig, AutoModel
model_path = "turing-motors/Heron-NVILA-Lite-2B"
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
model = AutoModel.from_config(config, trust_remote_code=True, device_map="auto")
model = AutoModel.from_pretrained(model_path, trust_remote_code=True, device_map="auto")
print(model.tokenizer.chat_template)
response = model.generate_content(["こんにちは"])
print(response)
print("---" * 40)
from PIL import Image
import requests
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
response = model.generate_content([image, "画像を説明してください。"])
print(response)
print("---" * 40)
from transformers import GenerationConfig
generation_config = {
"max_new_tokens": 512,
"temperature": 0.5,
"do_sample": True,
}
response = model.generate_content(
[image, "画像を説明してください。"],
generation_config=GenerationConfig(**generation_config)
)
print(response)
print("---" * 40)
url_list = [
"https://images.unsplash.com/photo-1694831404826-3400c48c188d",
"https://images.unsplash.com/photo-1693240876439-473af88b4ed7"
]
images = [Image.open(requests.get(url, stream=True).raw).convert("RGB") for url in url_list]
response = model.generate_content([
images[0], "これは日本の画像です",
images[1], "これはオーストリアの画像です",
"各画像の違いを説明して"
])
print(response)
训练摘要
性能评估
使用 llm-jp-eval-mm 基准测试,对比结果如下(2025年3月数据):
模型 |
LLM参数量 |
综合得分(%) |
野生图像理解(5分制) |
视觉问答(5分制) |
Heron-NVILA-Lite-2B |
1.5B |
52.8 |
3.52 |
3.50 |
GPT-4o |
- |
87.6 |
3.85 |
3.58 |
风险声明
本模型为实验性成果,未完全通过伦理合规性校准,敏感场景需谨慎使用。
许可协议
致谢
本项目获日本新能源产业技术综合开发机构(NEDO)JPNP20017项目资助,并使用了以下开源资源: