Views
No views yet

The DREX-062225-exp (Document Retrieval and Extraction eXpert) model is a specialized fine-tuned version of docscopeOCR-7B-050425-exp, optimized for Document Retrieval, Content Extraction, and Analysis Recognition. Built on top of the Qwen2.5-VL architecture, this model enhances document comprehension capabilities with focused training on the Opendoc2-Analysis-Recognition dataset for superior document analysis and information extraction tasks.
[!note] DREX: Document Retrieval and Extraction eXpert [ experimental ]


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/DREX-062225-exp", torch_dtype="auto", device_map="auto"
6)
7
8processor = AutoProcessor.from_pretrained("prithivMLmods/DREX-062225-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": "Extract and analyze the key information from this document."},
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 | Opendoc2-Analysis-Recognition |
| Dataset Size | 6,910 samples |
| Base Model | docscopeOCR-7B-050425-exp |
| Model Architecture | Qwen2_5_VLForConditionalGeneration |
| Hardware | 2 × A40 (19 vCPUs) |
| Total Disk | 280,000 MB |
| Training Time | 3,407 seconds (~0.95 hours) |
| Warmup Steps | 250 |
| Precision | bfloat16 |
[!note] This model builds upon the robust foundation of docscopeOCR-7B-050425-exp with specialized training for document retrieval and extraction tasks.