Views
No views yet
Primary Stage: Focus on judgment and classification tasks to strengthen the model’s understanding of problem structures and basic logic.
Intermediate Stage: Introduce multiple-choice and matching questions to improve the model’s ability to identify key information among distractors.
Advanced Stage: Expand to open-ended generation tasks to encourage the model to conduct free deduction and complete logical expression.
| Benchmark | Qwen2.5-VL-3B | TianJiangZhuGe-3B |
|---|---|---|
| POPE | 0.7676 | 0.8 |
| ai2d | 0.6343 | 0.6833 |
| vizwiz_val | 0.6099 | 0.6062 |
| MathVision | 22.86 | 22.14 |
| OCRBench | 68.1 | 71.4 |
| MathVista | 40.8 | 44.4 |
1from transformers import AutoModelForCausalLM, AutoTokenizer, Qwen2VLImageProcessor
2from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
3from qwen_vl_utils import process_vision_info
4
5
6device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
7messages = [[{"role": "user", "content": [{"type": "image", "image": "file:///path/to/image1.jpg"}, {"type": "text", "text": "Describe this image."}]}],]
8text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
9
10model_path = '/nfs4/models/Tianjiangzhuge'
11model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, dtype=torch.float16).to(device)
12inputs = processor(text=text, images=images, videos=videos, padding=True, return_tensors="pt", **video_kwargs).to(device)
13
14generated_ids = model.generate(**inputs)1# Messages containing multiple images and a text query
2messages = [
3 {
4 "role": "user",
5 "content": [
6 {"type": "image", "image": "file:///path/to/image1.jpg"},
7 {"type": "image", "image": "file:///path/to/image2.jpg"},
8 {"type": "text", "text": "Describe the difference between these images."},
9 ],
10 }
11]
12
13text = processor.apply_chat_template(
14 messages, tokenize=False, add_generation_prompt=True
15)