🚀 Heron-NVILA-Lite-1B
Heron-NVILA-Lite-1Bは、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
✨ 主な機能
- 多言語対応:日本語と英語をサポートしています。
- マルチモーダル処理:画像とテキストを組み合わせたタスクに対応しています。
- 高性能:評価結果によると、他のモデルと比較して良好な性能を示しています。
📦 インストール
必要なライブラリをインストールするには、以下のコマンドを実行してください。
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-1B"
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 PIL import Image
import requests
from transformers import GenerationConfig
generation_config = {
"max_new_tokens": 512,
"temperature": 0.5,
"do_sample": True,
}
generation_config = GenerationConfig(**generation_config)
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
response = model.generate_content(
[image, "画像を説明してください。"],
generation_config=generation_config
)
print(response)
print("---" * 40)
from PIL import Image
import requests
url_list = [
"https://images.unsplash.com/photo-1694831404826-3400c48c188d?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
"https://images.unsplash.com/photo-1693240876439-473af88b4ed7?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
]
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)
print("---" * 40)
📚 ドキュメント
モデル概要
学習概要
ステージ |
学習内容 |
データソース |
サンプル数 |
ステージ1 |
プロジェクター |
Japanese image text pairs, LLaVA-Pretrain |
1.1M |
ステージ2 |
プロジェクター、LLM |
Filtered MOMIJI (CC-MAIN-2024-46, CC-MAIN-2024-51, CC-MAIN-2025-05) |
13M |
|
|
Japanese image text pairs (subset), Japanese interleaved data (subset), mmc4-core (subset), coyo-700m (subset), wikipedia_ja, llava_pretrain_ja, stair_captions |
20M |
ステージ3 |
ビジョンエンコーダ、プロジェクター、LLM |
llava-instruct-v1_5-en-subset-358k, llava-instruct-ja, japanese-photos-conv, ja-vg-vqa, synthdog-ja (subset), ai2d, synthdog-en, sherlock |
1.1M |
評価
この評価では、llm-jp-eval-mmを使用しました。Heron-NVILA-LiteおよびSarashina2-Vision-14B以外のモデルのスコアは、2025年3月時点のllm-jp-eval-mm leaderboardとAsagi websiteから取得しました。Heron-NVILA-LiteとSarashina2-Vision-14Bは、"gpt-4o-2024-05-13"を使用したllm-as-a-judgeで評価されました。Sarashina2-Vision-14Bは、公式ブログで"gpt-4o-2024-08-06"を使用して評価されています。評価条件が異なるため、Sarashina2-Vision-14Bの結果は参考程度に捉えてください。
🔧 技術詳細
このモデルは、NVILA-Liteアーキテクチャに基づいて構築されています。ビジョンエンコーダとしてpaligemma-siglip-so400m-patch14-448を使用し、LLMとしてQwen2.5-0.5B-Instructを使用しています。
📄 ライセンス
謝辞
このモデルは、独立行政法人新エネルギー・産業技術総合開発機構(NEDO)の補助事業「JPNP20017」の成果を活用して構築されています。
以下のオープンソースリポジトリの利用に感謝申し上げます。
⚠️ 重要提示
このモデルは実験的なものであり、倫理的な遵守や法的基準について十分に検証されていません。敏感なアプリケーションでの使用には注意が必要です。