🚀 Curr-ReFT 多模态大语言模型
Curr-ReFT 是一个基于 Qwen2.5-VL 微调的多模态大语言模型,采用创新的 Curr-ReFT 方法,经过两阶段训练,显著提升了视觉语言理解和推理能力,适用于视觉推理、详细图像理解和多模态问题解决等复杂任务。
🚀 快速开始
数据与模型链接
- Curr-ReFT 数据:
- Curr-ReFT 模型:
✨ 主要特性
这是一个使用创新的 Curr-ReFT 方法从 Qwen2.5-VL 微调而来的多模态大语言模型。该模型经过了两阶段的训练过程:首先是课程强化学习,逐步增加任务复杂度;然后是基于拒绝样本的自我改进,以保持基础能力。
该模型显著增强了视觉 - 语言理解和推理能力,非常适合复杂任务,如视觉推理、详细图像理解和多模态问题解决。凭借其强大的多模态推理能力,Curr-ReFT 成为一个强大的人工智能助手,能够以更高的准确性和上下文感知能力应对不同领域的各种挑战。
📦 安装指南
暂未提供相关安装步骤信息。
💻 使用示例
基础用法
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
import torch
from qwen_vl_utils import process_vision_info
MODEL_ID = "Curr-ReFT-3B"
processor = AutoProcessor.from_pretrained(MODEL_ID, trust_remote_code=True)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
MODEL_ID,
trust_remote_code=True,
torch_dtype=torch.bfloat16
).to("cuda").eval()
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": "<your image path>"},
{"type": "text", "text": "Hint: Please answer the question and provide the final answer at the end. Question: Which number do you have to write in the last daisy?"},
],
}
]
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(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=4096)
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)
📚 详细文档
训练配置
- 框架:训练过程使用开源的 R1-V 库,以 Qwen2.5-VL-Instruct 为基础模型。该模型有 3B 和 7B 两种变体。
grpo 的训练配置如下:
max_pixels 401408
per_device_train_batch_size: 1
gradient_accumulation_steps: 1
learning_rate: 1.0e-5
num_train_epochs: 1.0
lr_scheduler_type: cosine
bf16: true
flash_attn: fa2
🔧 技术细节
暂未提供更详细的技术细节信息。
📄 许可证
本项目采用 Apache-2.0 许可证。
🏢 研究机构
- 中兴通讯人工智能研究院(ZTE-AIM)
- 中国科学技术大学
📞 模型联系信息
- huilin_deng@mail.ustc.edu.cn
- zoudinghust@gmail.com
- 214711069@csu.edu.cn