Llave 2B
LLaVE-2BはAquila-VL-2Bモデルを基にした20億パラメータのマルチモーダル埋め込みモデルで、4Kトークンのコンテキストウィンドウを持ち、テキスト、画像、複数画像、動画の埋め込み表現をサポートします。
ダウンロード数 20.05k
リリース時間 : 2/9/2025
モデル概要
LLaVE-2Bはマルチモーダル埋め込みモデルで、テキスト、画像、複数画像、動画の埋め込み表現が可能であり、文の類似度やゼロショット画像分類などのタスクに適しています。
モデル特徴
マルチモーダル埋め込み
テキスト、画像、複数画像、動画の埋め込み表現をサポートし、複数のモダリティのデータを処理できます。
4Kトークンコンテキストウィンドウ
4Kトークンのコンテキストウィンドウを持ち、長い入力シーケンスを処理できます。
ゼロショット画像分類
追加のトレーニングデータなしで、ゼロショット設定で画像分類タスクを実行できます。
転移学習能力が高い
画像-テキストデータでトレーニングされていますが、テキスト-動画検索タスクに一般化でき、優れたパフォーマンスを示します。
モデル能力
テキスト埋め込み
画像埋め込み
動画埋め込み
マルチモーダル埋め込み
文の類似度計算
ゼロショット画像分類
動画-テキスト検索
使用事例
画像検索
画像-テキスト検索
テキスト記述に基づいて関連画像を検索
MMEBランキングで優れた成績を収めました
動画検索
ゼロショット動画-テキスト検索
テキスト記述に基づいて関連動画を検索
優れたパフォーマンスを示し、他の埋め込みタスクへの転移可能性を示しました
🚀 LLaVE-2B
LLaVE-2Bは、Aquila-VL-2Bモデルに基づく20億パラメータのマルチモーダル埋め込みモデルで、4Kトークンのコンテキストウィンドウを持ち、テキスト、画像、複数画像、ビデオの埋め込みが可能です。
🚀 クイックスタート
まずはGitHubリポジトリをクローンします。
git clone https://github.com/DeepLearnXMU/LLaVE
cd LLaVE
pip install -e ".[train]"
このモデルを使用するための簡単な埋め込みプロセスを提供しています。詳細については、Githubを参照してください。
基本的な使用法
# pip install git+https://github.com/DeepLearnXMU/LLaVE
import torch
import copy
from PIL import Image
from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN
from llava.conversation import conv_templates
from llava.model.builder import load_pretrained_model
from llava.mm_utils import tokenizer_image_token, process_images
pretrained = "zhibinlan/LLaVE-2B"
model_name = "llava_qwen"
device = "cuda"
device_map = "auto"
tokenizer, model, image_processor, max_length = load_pretrained_model(pretrained, None, model_name, device_map=device_map) # Add any other thing you want to pass in llava_model_args
model.eval()
# Image + Text -> Text
image = Image.open("figures/example.jpg")
image_tensor = process_images([image], image_processor, model.config)
image_tensor = [_image.to(dtype=torch.float16, device=device) for _image in image_tensor]
conv_template = "qwen_1_5" # Make sure you use correct chat template for different models
question = DEFAULT_IMAGE_TOKEN + " Represent the given image with the following question: What is in the image"
conv = copy.deepcopy(conv_templates[conv_template])
conv.append_message(conv.roles[0], question)
conv.append_message(conv.roles[1], "\n")
prompt_question = conv.get_prompt()
input_ids = tokenizer_image_token(prompt_question, tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt").unsqueeze(0).to(device)
attention_mask=input_ids.ne(tokenizer.pad_token_id)
image_sizes = [image.size]
query_embed = model.encode_multimodal_embeddings(input_ids, attention_mask=attention_mask,images=image_tensor, image_sizes=image_sizes)
target_string = "A cat and a dog"
conv = copy.deepcopy(conv_templates[conv_template])
conv.append_message(conv.roles[0], target_string)
conv.append_message(conv.roles[1], "\n")
target_string = conv.get_prompt()
target_input_ids = tokenizer(target_string, return_tensors="pt").input_ids.to(device)
attention_mask=target_input_ids.ne(tokenizer.pad_token_id)
target_embed = model.encode_multimodal_embeddings(target_input_ids, attention_mask=attention_mask)
print("A cat and a dog similarity score: ", query_embed @ target_embed.T)
# 2B: A cat and a dog similarity score: tensor([[0.5132]]
neg_string = "A cat and a tiger"
conv = copy.deepcopy(conv_templates[conv_template])
conv.append_message(conv.roles[0], neg_string)
conv.append_message(conv.roles[1], "\n")
neg_string = conv.get_prompt()
neg_input_ids = tokenizer(neg_string, return_tensors="pt").input_ids.to(device)
attention_mask=neg_input_ids.ne(tokenizer.pad_token_id)
neg_embed = model.encode_multimodal_embeddings(neg_input_ids, attention_mask=attention_mask)
print("A cat and a tiger similarity score: ", query_embed @ neg_embed.T)
# 2B: A cat and a tiger similarity score: tensor([[0.3809]]
# Text -> Image
pos_string = "Find me an everyday image that matches the given caption: A cat and a dog."
conv = copy.deepcopy(conv_templates[conv_template])
conv.append_message(conv.roles[0], pos_string)
conv.append_message(conv.roles[1], "\n")
pos_string = conv.get_prompt()
pos_input_ids = tokenizer(pos_string, return_tensors="pt").input_ids.to(device)
attention_mask=pos_input_ids.ne(tokenizer.pad_token_id)
pos_query_embed = model.encode_multimodal_embeddings(pos_input_ids, attention_mask=attention_mask)
target = DEFAULT_IMAGE_TOKEN + " Represent the given image."
conv = copy.deepcopy(conv_templates[conv_template])
conv.append_message(conv.roles[0], target)
conv.append_message(conv.roles[1], "\n")
prompt_target = conv.get_prompt()
target_input_ids = tokenizer_image_token(prompt_target, tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt").unsqueeze(0).to(device)
attention_mask=target_input_ids.ne(tokenizer.pad_token_id)
target_image_sizes = [image.size]
target_embed = model.encode_multimodal_embeddings(target_input_ids, attention_mask=attention_mask,images=image_tensor, image_sizes=target_image_sizes)
print("A cat and a dog image similarity score: ", pos_query_embed @ target_embed.T)
# 2B: A cat and a dog similarity score: tensor([[0.5225]]
neg_string = "Find me an everyday image that matches the given caption: A cat and a tiger."
conv = copy.deepcopy(conv_templates[conv_template])
conv.append_message(conv.roles[0], neg_string)
conv.append_message(conv.roles[1], "\n")
neg_string = conv.get_prompt()
neg_input_ids = tokenizer(neg_string, return_tensors="pt").input_ids.to(device)
attention_mask=neg_input_ids.ne(tokenizer.pad_token_id)
neg_query_embed = model.encode_multimodal_embeddings(neg_input_ids, attention_mask=attention_mask)
print("A cat and a tiger image similarity score: ", neg_query_embed @ target_embed.T)
# 2B: A cat and a dog similarity score: tensor([[0.4141]]
✨ 主な機能
- テキスト、画像、複数画像、ビデオの埋め込みが可能です。
- 少量のデータのみを使用して、MMEBリーダーボードで上位ランキングを達成しました。
- 画像-テキストデータで学習されたモデルが、ゼロショット方式でテキスト-ビデオ検索タスクに一般化し、強力な性能を発揮します。
📚 ドキュメント
モデル概要
LLaVEモデルは、Aquila-VL-2Bモデルに基づく20億パラメータのマルチモーダル埋め込みモデルで、4Kトークンのコンテキストウィンドウを持っています。
学習/評価データ
- 学習データ: https://huggingface.co/datasets/TIGER-Lab/MMEB-train
- 評価データ: https://huggingface.co/datasets/TIGER-Lab/MMEB-eval
使用目的
このモデルは、テキスト、画像、複数画像、ビデオを埋め込む能力を持っています。
MMEBリーダーボード
少量のデータのみを使用して、MMEBリーダーボードで上位ランキングを達成しました。
モデルの性能
LLaVE-2Bは、より少ないパラメータと662Kの学習ペアを使用して、MMEBで優れた性能を達成しました。
LLaVEは画像-テキストデータで学習されていますが、ゼロショット方式でテキスト-ビデオ検索タスクに一般化し、強力な性能を発揮し、他の埋め込みタスクへの転移の可能性を示しています。
ハードウェアとソフトウェア
- GPU: 8 * Nvidia A100 (40G) (モデル全体の学習用)
- オーケストレーション: Huggingface Trainer
- ニューラルネットワーク: PyTorch
引用
@article{lan2025llave,
title={LLaVE: Large Language and Vision Embedding Models with Hardness-Weighted Contrastive Learning},
author={Lan, Zhibin and Niu, Liqiang and Meng, Fandong and Zhou, Jie and Su, Jinsong},
journal={arXiv preprint arXiv:2503.04812},
year={2025}
}
📄 ライセンス
このモデルは、Apache-2.0ライセンスの下で提供されています。
📦 その他の情報
属性 | 详情 |
---|---|
パイプラインタグ | 画像-テキスト-テキスト |
ライブラリ名 | transformers |
ベースモデル | BAAI/Aquila-VL-2B-llava-qwen |
タグ | 文書類似度、埋め込み、ゼロショット画像分類、ビデオ-テキスト-テキスト |
Clip Vit Large Patch14 336
Vision Transformerアーキテクチャに基づく大規模な視覚言語事前学習モデルで、画像とテキストのクロスモーダル理解をサポートします。
テキスト生成画像
Transformers

C
openai
5.9M
241
Fashion Clip
MIT
FashionCLIPはCLIPを基に開発された視覚言語モデルで、ファッション分野に特化してファインチューニングされ、汎用的な製品表現を生成可能です。
テキスト生成画像
Transformers 英語

F
patrickjohncyh
3.8M
222
Gemma 3 1b It
Gemma 3はGoogleが提供する軽量で先進的なオープンモデルシリーズで、Geminiモデルと同じ研究と技術に基づいて構築されています。このモデルはマルチモーダルモデルであり、テキストと画像の入力を処理し、テキスト出力を生成できます。
テキスト生成画像
Transformers

G
google
2.1M
347
Blip Vqa Base
Bsd-3-clause
BLIPは統一された視覚言語事前学習フレームワークで、視覚質問応答タスクに優れており、言語-画像共同トレーニングによりマルチモーダル理解と生成能力を実現
テキスト生成画像
Transformers

B
Salesforce
1.9M
154
CLIP ViT H 14 Laion2b S32b B79k
MIT
OpenCLIPフレームワークを使用してLAION-2B英語データセットでトレーニングされた視覚-言語モデルで、ゼロショット画像分類とクロスモーダル検索タスクをサポートします
テキスト生成画像
Safetensors
C
laion
1.8M
368
CLIP ViT B 32 Laion2b S34b B79k
MIT
OpenCLIPフレームワークを使用し、LAION-2B英語サブセットでトレーニングされた視覚-言語モデルで、ゼロショット画像分類とクロスモーダル検索をサポート
テキスト生成画像
Safetensors
C
laion
1.1M
112
Pickscore V1
PickScore v1はテキストから生成された画像に対するスコアリング関数で、人間の選好予測、モデル性能評価、画像ランキングなどのタスクに使用できます。
テキスト生成画像
Transformers

P
yuvalkirstain
1.1M
44
Owlv2 Base Patch16 Ensemble
Apache-2.0
OWLv2はゼロショットテキスト条件付き物体検出モデルで、テキストクエリを使用して画像内のオブジェクトを位置特定できます。
テキスト生成画像
Transformers

O
google
932.80k
99
Llama 3.2 11B Vision Instruct
Llama 3.2はMetaがリリースした多言語マルチモーダル大規模言語モデルで、画像テキストからテキストへの変換タスクをサポートし、強力なクロスモーダル理解能力を備えています。
テキスト生成画像
Transformers 複数言語対応

L
meta-llama
784.19k
1,424
Owlvit Base Patch32
Apache-2.0
OWL-ViTはゼロショットのテキスト条件付き物体検出モデルで、特定カテゴリの訓練データなしにテキストクエリで画像内のオブジェクトを検索できます。
テキスト生成画像
Transformers

O
google
764.95k
129
おすすめAIモデル
Llama 3 Typhoon V1.5x 8b Instruct
タイ語専用に設計された80億パラメータの命令モデルで、GPT-3.5-turboに匹敵する性能を持ち、アプリケーションシナリオ、検索拡張生成、制限付き生成、推論タスクを最適化
大規模言語モデル
Transformers 複数言語対応

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-TinyはSODAデータセットでトレーニングされた超小型対話モデルで、エッジデバイス推論向けに設計されており、体積はCosmo-3Bモデルの約2%です。
対話システム
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
RoBERTaアーキテクチャに基づく中国語抽出型QAモデルで、与えられたテキストから回答を抽出するタスクに適しています。
質問応答システム 中国語
R
uer
2,694
98