Instructions to use ikellllllll/vqa-improved-epoch1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ikellllllll/vqa-improved-epoch1 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct") model = PeftModel.from_pretrained(base_model, "ikellllllll/vqa-improved-epoch1") - Transformers
How to use ikellllllll/vqa-improved-epoch1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ikellllllll/vqa-improved-epoch1") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ikellllllll/vqa-improved-epoch1", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ikellllllll/vqa-improved-epoch1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ikellllllll/vqa-improved-epoch1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ikellllllll/vqa-improved-epoch1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ikellllllll/vqa-improved-epoch1
- SGLang
How to use ikellllllll/vqa-improved-epoch1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ikellllllll/vqa-improved-epoch1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ikellllllll/vqa-improved-epoch1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ikellllllll/vqa-improved-epoch1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ikellllllll/vqa-improved-epoch1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use ikellllllll/vqa-improved-epoch1 with Docker Model Runner:
docker model run hf.co/ikellllllll/vqa-improved-epoch1
VQA Improved Model - Epoch 1
Fine-tuned VQA model using Qwen2.5-VL-3B-Instruct with LoRA.
Performance:
- Validation Accuracy: 90.49% (352/389)
- Best individual model in the project! 🏆
- Improvement: +1.80% from baseline (88.69% → 90.49%)
Part of 3-Model Ensemble:
- Combined with Improved Epoch 2 and Base Model
- Ensemble Validation: 90.75%
- Ensemble Test (Kaggle): 91.82%
Model Details
- Base Model: Qwen/Qwen2.5-VL-3B-Instruct
- Fine-tuning Method: LoRA (Low-Rank Adaptation)
- Quantization: 4-bit (NF4)
- Hardware: NVIDIA A100 40GB
- Training: Additional 1 epoch on VQA dataset (604 samples)
LoRA Configuration
{
"r": 16,
"lora_alpha": 32,
"lora_dropout": 0.05,
"target_modules": [
"q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj"
]
}
Usage
from transformers import AutoModelForVision2Seq, AutoProcessor, BitsAndBytesConfig
from peft import PeftModel
import torch
# Load model with 4-bit quantization
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16
)
base_model = AutoModelForVision2Seq.from_pretrained(
"Qwen/Qwen2.5-VL-3B-Instruct",
quantization_config=bnb_config,
device_map="auto",
trust_remote_code=True
)
model = PeftModel.from_pretrained(base_model, "ikellllllll/vqa-improved-epoch1")
processor = AutoProcessor.from_pretrained(
"Qwen/Qwen2.5-VL-3B-Instruct",
min_pixels=512*512,
max_pixels=512*512,
trust_remote_code=True
)
# IMPORTANT: Set left-padding for decoder-only models
processor.tokenizer.padding_side = 'left'
Inference Settings
- Image Resolution: 512×512px
- Batch Size: 32 (for A100 40GB)
- Padding: Left-padding (critical for decoder-only models!)
Dataset
- Training: 604 VQA samples
- Validation: 389 VQA samples
- Test: 3,887 VQA samples
Links
- GitHub Repository: SSAFY_AI_competition
- Related Models:
- vqa-improved-epoch2 (90.23%)
- vqa-base-model (88.69%)
Citation
@misc{vqa-improved-epoch1,
author = {Team 203},
title = {VQA Improved Model - Epoch 1},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/ikellllllll/vqa-improved-epoch1}}
}
License
Apache 2.0
- Downloads last month
- 1
Model tree for ikellllllll/vqa-improved-epoch1
Base model
Qwen/Qwen2.5-VL-3B-Instruct