1import torch
2from transformers import LlavaForConditionalGeneration, AutoProcessor
3from PIL import Image
4
5model_id = "alpharomercoma/vqwen3-4b"
6model = LlavaForConditionalGeneration.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
7processor = AutoProcessor.from_pretrained(model_id)
8
9image = Image.open("my_image.jpg").convert("RGB")
10messages = [{
11 "role": "user",
12 "content": [
13 {"type": "image"},
14 {"type": "text", "text": "Describe this image in detail."},
15 ],
16}]
17
18prompt = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
19inputs = processor(text=prompt, images=image, return_tensors="pt").to(model.device)
20inputs["pixel_values"] = inputs["pixel_values"].to(torch.bfloat16)
21
22out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
23reply = processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
24print(reply)
Two-stage reproduction of the LLaVA-1.5 recipe, both stages on a single H200 141 GB.
The stage-2 LoRA has been merged back into Qwen3's weights in this release,
so loading is a single .from_pretrained() call.
Apache 2.0 for the projector weights and LoRA-merged Qwen3 delta.
Base models retain their original licenses: OpenAI CLIP (MIT), Qwen3-4B (Apache 2.0).