dinhquangson commited on
Commit
e3e5ff3
Β·
verified Β·
1 Parent(s): a872f7a

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +83 -84
README.md CHANGED
@@ -1,119 +1,118 @@
1
  ---
2
- language:
3
- - en
4
- - zh
5
  license: apache-2.0
6
- library_name: transformers
7
  tags:
8
  - vision
9
  - ocr
10
- - multimodal
11
- - text-recognition
12
  - document-analysis
 
 
13
  - gguf
14
- - quantized
15
- - qwen2.5-vl
16
- base_model: MonkeyAI/MonkeyOCR-pro-1.2B
17
- model_type: qwen2vl
 
 
 
18
  pipeline_tag: image-text-to-text
19
  ---
20
 
21
- # MonkeyOCR Pro 1.2B Vision - GGUF
 
 
 
 
22
 
23
- This is a **vision-enabled** GGUF quantized version of MonkeyOCR Pro 1.2B, optimized for OCR and document analysis tasks.
 
 
 
 
24
 
25
- ## πŸ”₯ Key Features
26
 
27
- - **Vision-Language Model**: Supports both text and image inputs
28
- - **OCR Optimized**: Excellent performance on text recognition tasks
29
- - **Quantized**: Q8_0 quantization for optimal quality/size balance
30
- - **Large Context**: 128,000 token context length
31
- - **Architecture**: Based on Qwen2.5-VL
32
 
33
- ## πŸš€ Model Architecture
 
 
34
 
35
- - **Base Architecture**: Qwen2.5-VL (Vision-Language)
36
- - **Parameters**: 1.2B
37
- - **Quantization**: Q8_0
38
- - **File Size**: ~1.3GB
39
- - **Context Length**: 128,000 tokens
40
- - **Vision Support**: βœ… Enabled
41
 
42
- ## πŸ“Š Model Specifications
 
 
 
43
 
44
- | Specification | Value |
45
- |---------------|-------|
46
- | Model Type | Vision-Language (qwen2vl) |
47
- | Parameters | 1.2B |
48
- | Quantization | Q8_0 |
49
- | Vision Support | Yes |
50
- | OCR Optimized | Yes |
51
- | Context Length | 128K tokens |
52
- | File Format | GGUF |
53
 
54
- ## πŸ’» Usage
 
 
 
55
 
56
- This model can be used with any GGUF-compatible inference engine that supports vision models:
57
 
58
- ### llama.cpp
59
- ```bash
60
- # Make sure you have llama.cpp built with vision support
61
- ./llama-cli -m MonkeyOCR-pro-1.2B-Recognition.gguf --image your_image.jpg -p "Describe this image"
 
 
 
 
 
 
 
 
 
 
62
  ```
63
 
64
- ### Python with llama-cpp-python
65
- ```python
66
- from llama_cpp import Llama
67
-
68
- # Load the model
69
- llm = Llama(
70
- model_path="MonkeyOCR-pro-1.2B-Recognition.gguf",
71
- chat_format="qwen2vl",
72
- n_ctx=2048,
73
- verbose=False
74
- )
75
-
76
- # Use with image
77
- response = llm.create_chat_completion(
78
- messages=[{
79
- "role": "user",
80
- "content": [
81
- {"type": "text", "text": "What text do you see in this image?"},
82
- {"type": "image_url", "image_url": {"url": "path/to/your/image.jpg"}}
83
- ]
84
- }]
85
- )
86
  ```
87
 
88
- ## 🎯 Use Cases
89
 
90
- - **Document OCR**: Extract text from scanned documents
91
- - **Image Text Recognition**: Read text in natural images
92
- - **Form Processing**: Analyze structured documents
93
- - **Receipt/Invoice Processing**: Extract information from receipts
94
- - **Multi-language Text Recognition**: Support for English and Chinese
95
- - **Vision-Language Tasks**: General multimodal understanding
96
 
97
- ## ⚠️ Requirements
98
 
99
- - Compatible inference engine with vision support (llama.cpp, etc.)
100
- - Sufficient RAM (recommend 4GB+ available)
101
- - For image processing: PIL/Pillow for image handling
 
 
102
 
103
- ## πŸ”§ Technical Details
104
 
105
- - **Original Model**: MonkeyAI/MonkeyOCR-pro-1.2B
106
- - **Conversion**: llama.cpp convert_hf_to_gguf.py
107
- - **Vision Components**: Integrated vision encoder
108
- - **Tokenizer**: Qwen2 tokenizer with vision tokens
109
- - **Special Tokens**: Image token (151665), Video token (151656)
110
 
111
  ## πŸ“ License
112
 
113
- This model follows the Apache 2.0 license of the original MonkeyOCR model.
114
 
115
  ## πŸ™ Credits
116
 
117
- - Original model by MonkeyAI
118
- - GGUF conversion using llama.cpp
119
- - Vision capabilities preserved through Qwen2.5-VL architecture
 
 
 
1
  ---
 
 
 
2
  license: apache-2.0
 
3
  tags:
4
  - vision
5
  - ocr
 
 
6
  - document-analysis
7
+ - multimodal
8
+ - qwen2vl
9
  - gguf
10
+ - lm-studio
11
+ model_type: vision-language
12
+ architecture: qwen2vl
13
+ quantization: q8_0
14
+ languages:
15
+ - en
16
+ - zh
17
  pipeline_tag: image-text-to-text
18
  ---
19
 
20
+ # MonkeyOCR-pro-1.2B Vision GGUF
21
+
22
+ A high-performance **vision-language model** specialized for **Optical Character Recognition (OCR)** and **document analysis**. This repository contains GGUF format models optimized for both general use and **LM Studio** compatibility.
23
+
24
+ ## 🎯 Model Capabilities
25
 
26
+ - βœ… **Vision-Language Processing**: Understand and process images with text
27
+ - βœ… **OCR (Optical Character Recognition)**: Extract text from images and documents
28
+ - βœ… **Document Structure Analysis**: Analyze layout, tables, and formatting
29
+ - βœ… **Multi-turn Conversations**: Chat about images and documents
30
+ - βœ… **Multiple Languages**: Support for English, Chinese, and more
31
 
32
+ ## πŸ“ Files Included
33
 
34
+ ### Standard GGUF Models
35
+ - **`MonkeyOCR-pro-1.2B-Recognition.gguf`** (1.26 GB) - Complete vision-enabled model
36
+ - **`MonkeyOCR-pro-1.2B.gguf`** (1.26 GB) - Alternative version
 
 
37
 
38
+ ### LM Studio Optimized
39
+ - **`MonkeyOCR-pro-1.2B-Text-LMStudio.gguf`** (1.23 GB) - Text model for LM Studio
40
+ - **`mmproj-MonkeyOCR-pro-1.2B-Vision-LMStudio.gguf`** (1.25 GB) - Vision projection for LM Studio
41
 
42
+ ## 🎨 LM Studio Setup (Recommended)
 
 
 
 
 
43
 
44
+ ### Step 1: Download Files
45
+ Download both LM Studio files:
46
+ - `MonkeyOCR-pro-1.2B-Text-LMStudio.gguf`
47
+ - `mmproj-MonkeyOCR-pro-1.2B-Vision-LMStudio.gguf`
48
 
49
+ ### Step 2: Install in LM Studio
50
+ 1. Copy both files to your LM Studio models directory
51
+ 2. Keep them in the same folder
52
+ 3. Open LM Studio and load the text model: `MonkeyOCR-pro-1.2B-Text-LMStudio.gguf`
53
+ 4. LM Studio will automatically detect and load the vision projection
 
 
 
 
54
 
55
+ ### Step 3: Enable Vision
56
+ 1. Start a new chat session
57
+ 2. Look for the camera/image icon in the chat interface
58
+ 3. Upload an image and start asking questions!
59
 
60
+ ## πŸ”§ Usage Examples
61
 
62
+ ### OCR Tasks
63
+ ```
64
+ User: [uploads image] Extract all text from this document
65
+ Assistant: I can see text in the image. Here's what I extracted:
66
+ [Provides accurate OCR results]
67
+ ```
68
+
69
+ ### Document Analysis
70
+ ```
71
+ User: [uploads form] Analyze the structure of this form
72
+ Assistant: This appears to be a [form type] with the following structure:
73
+ - Header section with title
74
+ - Main content area with fields for...
75
+ - Footer with signature area
76
  ```
77
 
78
+ ### Vision Q&A
79
+ ```
80
+ User: [uploads chart] What does this chart show?
81
+ Assistant: This chart displays [detailed analysis of the visual content]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  ```
83
 
84
+ ## βš™οΈ Technical Specifications
85
 
86
+ - **Architecture**: Qwen2.5-VL (qwen2vl)
87
+ - **Model Size**: 1.2B parameters
88
+ - **Quantization**: Q8_0 (8-bit)
89
+ - **Context Length**: 8,196 tokens
90
+ - **Vision Encoder**: CLIP-based projection
91
+ - **Input Support**: Images, text, multimodal conversations
92
 
93
+ ## πŸ”§ Configuration Details
94
 
95
+ The model includes proper vision token configuration:
96
+ - Image Token ID: 151655 (`<|image_pad|>`)
97
+ - Video Token ID: 151656 (`<|video_pad|>`)
98
+ - Vision Start: 151652 (`<|vision_start|>`)
99
+ - Vision End: 151653 (`<|vision_end|>`)
100
 
101
+ ## πŸš€ Performance
102
 
103
+ - **Fast inference** with Q8_0 quantization
104
+ - **High accuracy** OCR capabilities
105
+ - **Efficient memory usage** (~1.2-1.3 GB VRAM)
106
+ - **Multi-language support** for global documents
 
107
 
108
  ## πŸ“ License
109
 
110
+ Apache 2.0 - Free for commercial and research use
111
 
112
  ## πŸ™ Credits
113
 
114
+ Based on the MonkeyOCR model architecture with optimizations for GGUF format and LM Studio compatibility.
115
+
116
+ ---
117
+
118
+ **For best vision performance, use the LM Studio optimized files!** 🎯