Views
No views yet
Foundation checkpoint — not a deployable chat model. Only the Linear projector has been trained. Use this as the starting point for stage-2 instruction tuning. For ready-to-use TikTok sludge classifiers built on top of this foundation, see:
alpharomercoma/vqwen-qformer-tiktok-v2— current tri-modal model (vision + audio transcript), 99.04 % accuracy.alpharomercoma/vqwen-qformer-tiktok— vision-only ablation baseline, 89.00 % accuracy.
Blip2ForConditionalGeneration — no trust_remote_code.Image (224×224)
→ EVA-CLIP-G/14 (frozen, from Salesforce/blip2-opt-2.7b) → (B, 257, 1408)
→ Q-Former 12-layer (frozen, 32 pretrained query tokens) → (B, 32, 768)
→ Linear 768 → 2560 (trained — the only delta in this checkpoint)
→ Qwen3-4B (frozen)Linear(768, 2560)). Everything else is
loaded unchanged from its base checkpoint.EVA-01-CLIP-g/14, accessed
through the BLIP-2 bundle); hidden_size = 1408. The 32 in (B, 32, …) is
the Q-Former sequence length (learnable query tokens), not a feature dim.language_projection weights as
your starting projector. See the training code at
github.com/alpharomercoma/vqwen-qformer
(scripts 10b + 14) for a worked example.1import torch
2from PIL import Image
3from transformers import Blip2ForConditionalGeneration, AutoProcessor
4
5MODEL_ID = "alpharomercoma/vqwen-qformer-pretrain"
6model = Blip2ForConditionalGeneration.from_pretrained(MODEL_ID, dtype=torch.bfloat16, device_map="auto")
7processor = AutoProcessor.from_pretrained(MODEL_ID)
8
9image = Image.open("image.jpg").convert("RGB")
10messages = [{
11 "role": "user",
12 "content": [
13 {"type": "image"},
14 {"type": "text", "text": "Describe this image."},
15 ],
16}]
17prompt = processor.tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
18inputs = processor(text=prompt, images=image, return_tensors="pt").to(model.device)
19inputs["pixel_values"] = inputs["pixel_values"].to(dtype=torch.bfloat16)
20out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
21print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))liuhaotian/LLaVA-Pretrain — 558 K BLIP-captioned image–text
pairs (LAION / CC / SBU). Plain conversation format: <image> on the human
turn, caption on the assistant turn, loss masked on the human side.| Global batch size | 256 (per_device=128 × grad_accum=2) |
| Learning rate | 1e-4 cosine, warmup 0.03 |
| Weight decay | 0.05 |
| Optimizer | fused AdamW |
| Epochs | 1 (2,181 steps) |
| Max sequence length | 2,048 |
| Precision | bf16 |
1@misc{vqwenqformerpretrain,
2 author = {Olata, Marc and Coma, Alpha Romer and Ong, Job Isaac and Sioson, Kristoffer Ian},
3 title = {Visual-Qwen stage-1: feature-alignment foundation},
4 year = {2026},
5 publisher = {FEU Institute of Technology}
6}Linear(768, 2560) projector instead of an MLP (the Q-Former is already a
trained adapter).Salesforce/blip2-opt-2.7b (BSD-3), Qwen/Qwen3-4B (Apache 2.0). Dataset
license per liuhaotian/LLaVA-Pretrain.