Views
No views yet
1import torch
2from PIL import Image
3from transformers import AutoTokenizer, AutoProcessor, AutoModel, Qwen2ForCausalLM
4from peft import PeftModel
5
6from vlm_model import MLPProjector, SiglipQwenVLM
7
8#configurations
9DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
10
11LLM_NAME = "Qwen/Qwen2-0.5B-Instruct"
12VISION_NAME = "google/siglip-base-patch16-224"
13
14LORA_PATH = "lora_adapter"
15PROJECTOR_PATH = "projector.pt"
16
17NUM_IMAGE_TOKENS = 196
18
19#refer to inference.py for full code