Views
No views yet
1{
2 "r": 16,
3 "lora_alpha": 32,
4 "lora_dropout": 0.05,
5 "target_modules": [
6 "q_proj", "k_proj", "v_proj", "o_proj",
7 "gate_proj", "up_proj", "down_proj"
8 ]
9}1from transformers import AutoModelForVision2Seq, AutoProcessor, BitsAndBytesConfig
2from peft import PeftModel
3import torch
4
5# Load model with 4-bit quantization
6bnb_config = BitsAndBytesConfig(
7 load_in_4bit=True,
8 bnb_4bit_use_double_quant=True,
9 bnb_4bit_quant_type="nf4",
10 bnb_4bit_compute_dtype=torch.bfloat16
11)
12
13base_model = AutoModelForVision2Seq.from_pretrained(
14 "Qwen/Qwen2.5-VL-3B-Instruct",
15 quantization_config=bnb_config,
16 device_map="auto",
17 trust_remote_code=True
18)
19
20model = PeftModel.from_pretrained(base_model, "ikellllllll/vqa-improved-epoch1")
21processor = AutoProcessor.from_pretrained(
22 "Qwen/Qwen2.5-VL-3B-Instruct",
23 min_pixels=512*512,
24 max_pixels=512*512,
25 trust_remote_code=True
26)
27
28# IMPORTANT: Set left-padding for decoder-only models
29processor.tokenizer.padding_side = 'left'1@misc{vqa-improved-epoch1,
2 author = {Team 203},
3 title = {VQA Improved Model - Epoch 1},
4 year = {2025},
5 publisher = {HuggingFace},
6 howpublished = {\url{https://huggingface.co/ikellllllll/vqa-improved-epoch1}}
7}