Downloads · 30 days
0
fractionai/Qwen2-VL-2B-checkpoint
Qwen2-VL-2B-checkpoint is a machine learning model from fractionai. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a LoRA checkpoint for fine-tuning the Qwen2-VL-2B-Instruct model. The checkpoint is contained inside the qwen22B folder.
Downloads · 30 days
0
Access
Public
Updated Oct 6, 2024
Repo size
626 MB
Likes
0
Public
Click a slice to open those files.
.pt596 MB · 94%
From the Hugging Face model README
This is a LoRA checkpoint for fine-tuning the Qwen2-VL-2B-Instruct model. The checkpoint is contained inside the qwen2_2B folder.
To use this LoRA with the base model, load the base model and apply the LoRA checkpoint like this:
from peft import PeftModel
from transformers import Qwen2VLForConditionalGeneration
# Define the model type and path to the fine-tuned LoRA adapter
model_path = "Qwen/Qwen2-VL-2B"
path_to_adapter = "path_to_lora_checkpoint"
# Load the base pre-trained model
model = Qwen2VLForConditionalGeneration.from_pretrained(
model_path, torch_dtype='auto', device_map='cpu', attn_implementation='flash_attention_2'
)
# Load the LoRA adapter and move the model to GPU
lora_model = PeftModel.from_pretrained(
model,
path_to_adapter,
device_map="auto", # Automatically allocate model layers to available devices
trust_remote_code=True
).eval().cuda()
# Your code here