Views
No views yet

The docscopeOCR-7B-050425-exp model is a fine-tuned version of Qwen/Qwen2.5-VL-7B-Instruct, optimized for Document-Level Optical Character Recognition (OCR), long-context vision-language understanding, and accurate image-to-text conversion with mathematical LaTeX formatting. Built on top of the Qwen2.5-VL architecture, this model significantly improves document comprehension, structured data extraction, and visual reasoning across diverse input formats.
1from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
2from qwen_vl_utils import process_vision_info
3
4model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
5 "prithivMLmods/docscopeOCR-7B-050425-exp", torch_dtype="auto", device_map="auto"
6)
7
8processor = AutoProcessor.from_pretrained("prithivMLmods/docscopeOCR-7B-050425-exp")
9
10messages = [
11 {
12 "role": "user",
13 "content": [
14 {
15 "type": "image",
16 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
17 },
18 {"type": "text", "text": "Describe this image."},
19 ],
20 }
21]
22
23text = processor.apply_chat_template(
24 messages, tokenize=False, add_generation_prompt=True
25)
26image_inputs, video_inputs = process_vision_info(messages)
27inputs = processor(
28 text=[text],
29 images=image_inputs,
30 videos=video_inputs,
31 padding=True,
32 return_tensors="pt",
33)
34inputs = inputs.to("cuda")
35
36generated_ids = model.generate(**inputs, max_new_tokens=128)
37generated_ids_trimmed = [
38 out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
39]
40output_text = processor.batch_decode(
41 generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
42)
43print(output_text)| Parameter | Value |
|---|---|
| Dataset Size | 274,209 samples (Modular Combination of Datasets) |
| Model Architecture | Qwen2_5_VLForConditionalGeneration |
| Hardware | 2 × NVIDIA A100 SXM (32 vCPUs) |
| Total Disk | 170,000 MB |
| Training Time | 9,020 seconds (~2.51 hours) |
| Learning Rate | 1e-5 |
| Scheduler | Linear Decay |
| Warmup Steps | 750 |
| Precision | bfloat16 |
[!note] The open dataset image-text response will be updated soon.