🚀 tvl-mini
這是一個基於LoRA微調的模型,在俄語環境下對Qwen2-VL-2B進行了優化,可用於文本到文本的生成任務,支持多模態數據處理。
🚀 快速開始
你可以直接運行 此筆記本,或者運行以下代碼。
首先,安裝 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微調模型。
📦 安裝指南
首先,安裝 qwen-vl-utils
和 transformers
的開發版本:
pip install qwen-vl-utils
pip install --no-cache-dir git+https://github.com/huggingface/transformers@19e6e80e10118f855137b90740936c0b11ac397f
📚 詳細文檔
數據
數據集包含:
- GrandMaster-PRO-MAX數據集(68k樣本)
- 視覺推理(36k樣本) #訓練中
- 圖像描述(34k樣本) #訓練中
- 知識問答(35k樣本) #訓練中
- 問答(80k樣本) #訓練中
- 分類(21k樣本) #訓練中
- 對話(11k樣本) #訓練中
基準測試
TODO
📄 許可證
本項目採用Apache-2.0許可證。
屬性 |
詳情 |
模型類型 |
基於Qwen2-VL-2B的LORA微調模型 |
訓練數據 |
GrandMaster-PRO-MAX數據集、視覺推理數據、圖像描述數據、知識問答數據、問答數據、分類數據、對話數據 |
支持語言 |
俄語、英語 |
基礎模型 |
Qwen/Qwen2-VL-2B-Instruct |
任務類型 |
文本到文本生成 |
標籤 |
多模態 |
庫名稱 |
transformers |