Llave 7B
L
Llave 7B
zhibinlanによって開発
LLaVE-7BはLLaVA-OneVision-7Bモデルを基にした70億パラメータのマルチモーダル埋め込みモデルで、テキスト、画像、複数画像、動画の埋め込み表現能力を備えています。
ダウンロード数 1,389
リリース時間 : 2/9/2025
モデル概要
LLaVE-7Bはマルチモーダル埋め込みモデルで、テキスト、画像、複数画像、動画の埋め込み表現を処理でき、MMEBランキングで優れた性能を示し、強力な転移学習能力を発揮します。
モデル特徴
マルチモーダル埋め込み能力
テキスト、画像、複数画像、動画を同時に埋め込み表現できる
卓越した性能
66.2万のトレーニングサンプルのみでMMEBにおいて最先端の性能を実現
強力な転移能力
画像テキストデータでトレーニングされているが、テキスト-動画検索タスクにゼロショットで汎化できる
効率的なトレーニング
少量のデータのみで優れたパフォーマンスを達成
モデル能力
テキスト埋め込み表現
画像埋め込み表現
複数画像埋め込み表現
動画埋め込み表現
クロスモーダル検索
ゼロショット転移学習
使用事例
情報検索
クロスモーダル検索
テキストクエリに基づいて関連する画像や動画を検索
MMEBランキングで1位を獲得
コンテンツ理解
画像コンテンツ理解
画像内容を理解し関連するテキスト表現を生成
画像内の異なるオブジェクトを正確に区別できる
🚀 LLaVE-7B
LLaVE-7Bは、画像やテキスト、ビデオなどのマルチモーダルデータを扱うことができる埋め込みモデルです。このモデルは、LLaVA-OneVision-7Bモデルをベースに構築されており、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-7B"
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)
# 7B: A cat and a dog similarity score: tensor([[0.6240]]
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)
# 7B: A cat and a tiger similarity score: tensor([[0.4543]]
# 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)
# 7B: A cat and a dog similarity score: tensor([[0.5347]]
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)
# 7B: A cat and a dog similarity score: tensor([[0.4001]]
✨ 主な機能
- テキスト、画像、複数画像、ビデオを埋め込む能力を持っています。
- MMEBリーダーボードで上位ランキングを達成しています。
- 画像-テキストデータで学習されたモデルですが、ゼロショットでテキスト-ビデオ検索タスクにも汎化でき、強力な性能を発揮します。
📦 インストール
git clone https://github.com/DeepLearnXMU/LLaVE
cd LLaVE
pip install -e ".[train]"
📚 ドキュメント
モデル概要
LLaVEモデルは、LLaVA-OneVision-7Bモデルをベースにした70億パラメータのマルチモーダル埋め込みモデルで、4Kトークンのコンテキストウィンドウを持っています。
学習/評価データ
- 学習データ: https://huggingface.co/datasets/TIGER-Lab/MMEB-train
- 評価データ: https://huggingface.co/datasets/TIGER-Lab/MMEB-eval
MMEBリーダーボード
少量のデータのみを使用して、MMEBリーダーボードで上位ランキングを達成しました。
モデル性能
LLaVE-7Bは、わずか662Kの学習ペアを使用して、MMEBでSOTA性能を達成しました。
ハードウェアとソフトウェア
- GPU: 16 * Ascend 910B GPUs (64GB) (モデル全体の学習用)
- オーケストレーション: 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ライセンスの下で提供されています。
Codebert Base
CodeBERTはプログラミング言語と自然言語向けの事前学習モデルで、RoBERTaアーキテクチャに基づいており、コード検索やコードからドキュメント生成などの機能をサポートします。
マルチモーダル融合
C
microsoft
1.6M
248
Llama 4 Scout 17B 16E Instruct
その他
Llama 4 ScoutはMetaが開発したマルチモーダルAIモデルで、混合専門家アーキテクチャを採用し、12言語のテキストと画像インタラクションをサポート、17Bの活性化パラメータと109Bの総パラメータを有します。
マルチモーダル融合
Transformers 複数言語対応

L
meta-llama
817.62k
844
Unixcoder Base
Apache-2.0
UniXcoderは統一されたマルチモーダル事前学習モデルで、コードコメントや抽象構文木などのマルチモーダルデータを使用してコード表現を事前学習します。
マルチモーダル融合
Transformers 英語

U
microsoft
347.45k
51
TITAN
TITANは、病理学画像分析のための視覚的自己教師あり学習と視覚-言語アライメントによるマルチモーダル全スライド基礎モデルです。
マルチモーダル融合
Safetensors 英語
T
MahmoodLab
213.39k
37
Qwen2.5 Omni 7B
その他
Qwen2.5-Omniはエンドツーエンドのマルチモーダルモデルで、テキスト、画像、音声、ビデオなど様々なモダリティを認識し、ストリーミング方式でテキストや自然な音声レスポンスを生成できます。
マルチモーダル融合
Transformers 英語

Q
Qwen
206.20k
1,522
Minicpm O 2 6
MiniCPM-o 2.6はスマートフォンで動作するGPT-4oレベルのマルチモーダル大規模モデルで、視覚、音声、ライブストリーム処理をサポート
マルチモーダル融合
Transformers その他

M
openbmb
178.38k
1,117
Llama 4 Scout 17B 16E Instruct
その他
Llama 4 ScoutはMetaが開発した17Bパラメータ/16エキスパート混合のマルチモーダルAIモデルで、12言語と画像理解をサポートし、業界をリードする性能を有しています。
マルチモーダル融合
Transformers 複数言語対応

L
chutesai
173.52k
2
Qwen2.5 Omni 3B
その他
Qwen2.5-Omniはエンドツーエンドのマルチモーダルモデルで、テキスト、画像、音声、ビデオなど様々なモダリティ情報を認識し、ストリーミング方式でテキストと自然な音声応答を同期生成できます。
マルチモーダル融合
Transformers 英語

Q
Qwen
48.07k
219
One Align
MIT
Q-Alignはマルチタスク視覚評価モデルで、画像品質評価(IQA)、美的評価(IAA)、動画品質評価(VQA)に特化しており、ICML2024で発表されました。
マルチモーダル融合
Transformers

O
q-future
39.48k
25
Biomedvlp BioViL T
MIT
BioViL-Tは胸部X線画像と放射線レポートの分析に特化した視覚言語モデルで、時系列マルチモーダル事前学習により性能を向上させています。
マルチモーダル融合
Transformers 英語

B
microsoft
26.39k
35
おすすめ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