🚀 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 |