🚀 Heron-NVILA-Lite-33B
Heron-NVILA-Lite-33Bは、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-33B"
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 |
110万 |
段階2 |
プロジェクター、LLM |
フィルタリングされた MOMIJI (CC-MAIN-2024-42) |
300万 |
|
|
Japanese image text pairs (subset), Japanese interleaved data (subset), mmc4-core (subset), coyo-700m (subset), wikipedia_ja, llava_pretrain_ja, stair_captions |
2000万 |
段階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 |
110万 |
評価
この評価には llm-jp-eval-mm を使用しました。Heron-NVILA-Lite と Sarashina2-Vision-14B 以外のモデルのスコアは、2025年3月時点の llm-jp-eval-mm リーダーボード と Asagi ウェブサイト から取得しました。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 の結果は参考程度に扱ってください。
📄 ライセンス
🎈 謝辞
このモデルは、独立行政法人新エネルギー・産業技術総合開発機構(NEDO)の補助事業 JPNP20017 の成果に基づいています。
以下のオープンソースリポジトリの使用に感謝申し上げます。
⚠️ 重要提示
このモデルは実験的なものであり、倫理的な遵守や法的基準について十分に検証されていません。センシティブなアプリケーションでの使用には注意が必要です。