🚀 tvl - mini
このプロジェクトは、Qwen2 - VL - 2Bをロシア語でLORAファインチューニングしたものです。テキスト生成タスクに特化し、マルチモーダルなデータを扱うことができます。
🚀 クイックスタート
あなたは [このノートブック](https://www.kaggle.com/code/artemdzhalilov/tvl - hand - test) を実行するか、以下のコードを実行することができます。
まず、qwen - vl - utilsと開発版のtransformersをインストールします。
pip install qwen-vl-utils
pip install --no-cache-dir git+https://github.com/huggingface/transformers@19e6e80e10118f855137b90740936c0b11ac397f
次に、以下のコードを実行します。
from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info
import torch
model = Qwen2VLForConditionalGeneration.from_pretrained(
"2Vasabi/tvl-mini-0.1", torch_dtype=torch.bfloat16, device_map="auto"
)
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct")
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"image": "https://i.ibb.co/d0QL8s6/images.jpg",
},
{"type": "text", "text": "Кратко опиши что ты видишь на изображении"},
],
}
]
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
padding=True,
return_tensors="pt",
)
inputs = inputs.to("cuda")
generated_ids = model.generate(**inputs, max_new_tokens=1000)
generated_ids_trimmed = [
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)
✨ 主な機能
このモデルは、Qwen2 - VL - 2Bをロシア語でLORAファインチューニングしたもので、マルチモーダルなデータを用いたテキスト生成に特化しています。
📦 インストール
pip install qwen-vl-utils
pip install --no-cache-dir git+https://github.com/huggingface/transformers@19e6e80e10118f855137b90740936c0b11ac397f
📚 ドキュメント
説明
これは、Qwen2 - VL - 2Bをロシア語でLORAファインチューニングしたモデルです。
データ
データセットには以下が含まれます。
- GrandMaster - PRO - MAXデータセット (68kサンプル)
- 視覚推論 (36kサンプル) #学習中
- キャプショニング (34kサンプル) #学習中
- 知識ベースのVQA (35kサンプル) #学習中
- VQA (80kサンプル) #学習中
- 分類 (21kサンプル) #学習中
- 会話 (11kサンプル) #学習中
ベンチマーク
TODO
📄 ライセンス
このプロジェクトはApache - 2.0ライセンスの下で公開されています。