## File: README.md > **[SCIENCE CHINA Information Science] MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm** > Zhang Li, Yuliang Liu, Qiang Liu, Zhiyin Ma, Ziyang Zhang, Shuo Zhang, Zidun Guo, Jiarui Zhang, Xinyu Wang, Xiang Bai [](https://arxiv.org/abs/2506.05218) [](README.md) [](https://huggingface.co/echo840/MonkeyOCR) [](https://modelscope.cn/models/l1731396519/MonkeyOCR) [](https://openbayes.com/console/public/tutorials/91ESrGvEvBq) [](https://aiwrite.wps.cn/pdf/parse/web/) ## News > [!IMPORTANT] > 🚀 **MonkeyOCRv2 is here (July 2026)** — a document-native vision backbone plus a > 0.7B parser that is the new open-source SOTA on multilingual document parsing > (17 languages), now released under **Apache-2.0**. > 👉 **[Yuliang-Liu/MonkeyOCRv2](https://github.com/Yuliang-Liu/MonkeyOCRv2)** · [Paper](https://arxiv.org/abs/2607.11562) · [Demo](http://vlrlabmonkey.xyz:8891/) * ```2026.07.12 ``` 🚀 MonkeyOCR is accepted by SCIENCE CHINA Information Sciences. * ```2026.04.01 ``` 🚀 dots.mocr achieves the best open-source score on [MDPBench](https://arxiv.org/pdf/2603.28130), a 17-language document parsing benchmark! * ```2026.03.15 ``` 🚀 We release [dots.mocr](https://arxiv.org/pdf/2603.13032) Multimodal OCR: Parse Anything from Documents. * ```2026.01.30 ``` 🚀 We release [MonkeyDoc](https://www.modelscope.cn/datasets/zenosai/MonkeyDoc) and provide the necessary details of our data generation pipeline. * ```2025.11.14 ``` 🚀 We release [MonkeyOCR-v1.5](https://arxiv.org/abs/2511.10390) Technical Report, achieving the best document parsing performance to date. [Demo](https://aiwrite.wps.cn/pdf/parse/web/). * ```2025.07.10 ``` 🚀 We release [MonkeyOCR-pro-1.2B](https://huggingface.co/echo840/MonkeyOCR-pro-1.2B), a leaner and faster version model that outperforms our previous 3B version in accuracy, speed, and efficiency. * ```2025.06.12 ``` 🚀 The model’s trending on [Hugging Face](https://huggingface.co/models?sort=trending) #2. * ```2025.06.05 ``` 🚀 We release [MonkeyOCR](https://huggingface.co/echo840/MonkeyOCR), an English and Chinese documents parsing model. ## Introduction MonkeyOCR adopts a Structure-Recognition-Relation (SRR) triplet paradigm, which simplifies the multi-tool pipeline of modular approaches while avoiding the inefficiency of using large multimodal models for full-page document processing. 1. MonkeyOCR-pro-1.2B surpasses MonkeyOCR-3B by 7.4% on Chinese documents. 2. MonkeyOCR-pro-1.2B delivers approximately a 36% speed improvement over MonkeyOCR-pro-3B, with approximately 1.6% drop in performance. 3. On olmOCR-Bench, MonkeyOCR-pro-1.2B outperforms Nanonets-OCR-3B by 7.3%. 4. On OmniDocBench, MonkeyOCR-pro-3B achieves the best overall performance on both English and Chinese documents, outperforming even closed-source and extra-large open-source VLMs such as Gemini 2.0-Flash, Gemini 2.5-Pro, Qwen2.5-VL-72B, GPT-4o, and InternVL3-78B. See detailed results below. ### Comparing MonkeyOCR with closed-source and extra large open-source VLMs. ### Example for formula document ### Example for table document ### Example for newspaper ### Example for financial report ## Related Projects > **MonkeyOCR v1.5 Technical Report: Unlocking Robust Document Parsing for Complex Patterns** > Jiarui Zhang, Yuliang Liu, Zijun Wu, Guosheng Pang, Zhili Ye, Yupei Zhong, Junteng Ma, Tao Wei, Haiyang Xu, Weikai Chen, Zeen Wang, Qiangjun Ji, Fanxi Zhou, Qi Zhang, Yuanrui Hu, Jiahao Liu, Zhang Li, Ziyang Zhang, Qiang Liu, Xiang Bai [](https://arxiv.org/pdf/2511.10390) [](https://aiwrite.wps.cn/pdf/parse/web/) > > **Multimodal OCR: Parse Anything from Documents** > Handong Zheng, Yumeng Li, Kaile Zhang, Liang Xin, Guangwei Zhao, Hao Liu, Jiayu Chen, Jie Lou, Qi Fu, Rui Yang, Shuo Jiang, Weijian Luo, Weijie Su, Weijun Zhang, Xingyu Zhu, Yabin Li, Yiwei ma, Yu Chen, Yuqiu Ji, Zhaohui Yu, Guang Yang, Colin Zhang, Lei Zhang, Yuliang Liu, Xiang Bai [](https://arxiv.org/pdf/2603.13032) [](https://github.com/rednote-hilab/dots.mocr) [](https://www.youtube.com/watch?v=gkyDZtWGfh8) [](https://www.youtube.com/watch?v=BxH5KD5lDSM) [](https://mp.weixin.qq.com/s/EHNrk5SSCOReyTm7uv6nsg) [](https://hyper.ai/cn/notebooks/50071) > ## Citing MonkeyOCR If you wish to refer to the baseline results published here, please use the following BibTeX entries: ```BibTeX @misc{li2025monkeyocrdocumentparsingstructurerecognitionrelation, title={MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm}, author={Zhang Li and Yuliang Liu and Qiang Liu and Zhiyin Ma and Ziyang Zhang and Shuo Zhang and Zidun Guo and Jiarui Zhang and Xinyu Wang and Xiang Bai}, year={2025}, eprint={2506.05218}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2506.05218}, } @misc{zheng2026multimodalocrparsedocuments, title={Multimodal OCR: Parse Anything from Documents}, author={Handong Zheng and Yumeng Li and Kaile Zhang and Liang Xin and Guangwei Zhao and Hao Liu and Jiayu Chen and Jie Lou and Qi Fu and Rui Yang and Shuo Jiang and Weijian Luo and Weijie Su and Weijun Zhang and Xingyu Zhu and Yabin Li and Yiwei ma and Yu Chen and Yuqiu Ji and Zhaohui Yu and Guang Yang and Colin Zhang and Lei Zhang and Yuliang Liu and Xiang Bai}, year={2026}, eprint={2603.13032}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2603.13032}, } ``` ## Acknowledgments We would like to thank [MinerU](https://github.com/opendatalab/MinerU), [DocLayout-YOLO](https://github.com/opendatalab/DocLayout-YOLO), [PyMuPDF](https://github.com/pymupdf/PyMuPDF), [layoutreader](https://github.com/ppaanngggg/layoutreader), [Qwen2.5-VL](https://github.com/QwenLM/Qwen2.5-VL), [LMDeploy](https://github.com/InternLM/lmdeploy), [PP-StructureV3](https://github.com/PaddlePaddle/PaddleOCR), [PP-DocLayout_plus-L](https://huggingface.co/PaddlePaddle/PP-DocLayout_plus-L), and [InternVL3](https://github.com/OpenGVLab/InternVL) for providing base code and models, as well as their contributions to this field. We also thank [M6Doc](https://github.com/HCIILAB/M6Doc), [DocLayNet](https://github.com/DS4SD/DocLayNet), [CDLA](https://github.com/buptlihang/CDLA), [D4LA](https://github.com/AlibabaResearch/AdvancedLiterateMachinery), [DocGenome](https://github.com/Alpha-Innovator/DocGenome), [PubTabNet](https://github.com/ibm-aur-nlp/PubTabNet), and [UniMER-1M](https://github.com/opendatalab/UniMERNet) for providing valuable datasets. We also thank everyone who contributed to this open-source effort. ## Limitation Currently, MonkeyOCR do not yet fully support for photographed text, handwritten content, Traditional Chinese characters, or multilingual text. We plan to consider adding support for these features in future public releases. Additionally, our model is deployed on a single GPU, so if too many users upload files at the same time, issues like “This application is currently busy” may occur. The processing time shown on the demo page does not reflect computation time alone—it also includes result uploading and other overhead. During periods of high traffic, this time may be longer. The inference speeds of MonkeyOCR, MinerU, and Qwen2.5 VL-7B were measured on an H800 GPU. ## License and Commercial Use The source code in this repository is released under the Apache License 2.0. The MonkeyOCR v1 model weights are provided for academic research and non-commercial evaluation only. Commercial deployment, SaaS integration, redistribution, or production use requires a separate written commercial license. For commercial licensing inquiries, please contact xbai@hust.edu.cn or ylliu@hust.edu.cn. --- ## File: docs/install_cuda.md # Install with CUDA Support This guide walks you through setting up the environment for **MonkeyOCR** with CUDA support. You can choose **one** of the backends — [**LMDeploy**](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/docs/install_cuda.md#using-lmdeploy-as-the-inference-backend-optional)(recomended), [**vLLM**](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/docs/install_cuda.md#using-vllm-as-the-inference-backend-optional), or [**transformers**](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/docs/install_cuda.md#using-transformers-as-the-inference-backend-optional) — to install and use. It covers installation instructions for each of them. > **Note:** Based on our internal test, inference speed ranking is: **LMDeploy ≥ vLLM >>> transformers** ## Using **LMDeploy** as the Inference Backend (Optional) > **Supporting CUDA 12.4/12.1/11.8** If you're using **CUDA 12.4** or **CUDA 12.1**, follow these steps: ```bash conda create -n MonkeyOCR python=3.10 conda activate MonkeyOCR git clone https://github.com/Yuliang-Liu/MonkeyOCR.git cd MonkeyOCR export CUDA_VERSION=124 # for CUDA 12.4 # export CUDA_VERSION=121 # for CUDA 12.1 # Install PyTorch. Refer to https://pytorch.org/get-started/previous-versions/ for version compatibility pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu${CUDA_VERSION} pip install -e . pip install lmdeploy==0.8.0 ``` If you're using **CUDA 11.8**, use the following instead: ```bash conda create -n MonkeyOCR python=3.10 conda activate MonkeyOCR git clone https://github.com/Yuliang-Liu/MonkeyOCR.git cd MonkeyOCR # Install PyTorch. Refer to https://pytorch.org/get-started/previous-versions/ for version compatibility pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu118 pip install -e . pip install https://github.com/InternLM/lmdeploy/releases/download/v0.8.0/lmdeploy-0.8.0+cu118-cp310-cp310-manylinux2014_x86_64.whl --extra-index-url https://download.pytorch.org/whl/cu118 ``` > [!IMPORTANT] > ### Fixing the **Shared Memory Error** on **20/30/40 series / V100 ...** GPUs (Optional) > > Our 3B model runs smoothly on the NVIDIA RTX 30/40 series. However, when using **LMDeploy** as the inference backend, you might run into compatibility issues on these GPUs — typically this error: > > ``` > triton.runtime.errors.OutOfResources: out of resource: shared memory > ``` > > To resolve this issue, apply the following patch: > > ```bash > python tools/lmdeploy_patcher.py patch > ``` > **Note:** This command modifies LMDeploy’s source code in your environment. > To undo the changes, simply run: > > ```bash > python tools/lmdeploy_patcher.py restore > ``` > > Based on our tests on the **NVIDIA RTX 3090**, inference speed was **0.338 pages/second** using **LMDeploy** (with the patch applied), compared to only **0.015 pages/second** using **transformers**. > > **Special thanks to [@pineking](https://github.com/pineking) for the solution!** --- ## Using **vLLM** as the Inference Backend (Optional) > **Supporting CUDA 12.6/12.8/11.8** ```bash conda create -n MonkeyOCR python=3.10 conda activate MonkeyOCR git clone https://github.com/Yuliang-Liu/MonkeyOCR.git cd MonkeyOCR pip install uv --upgrade export CUDA_VERSION=126 # for CUDA 12.6 # export CUDA_VERSION=128 # for CUDA 12.8 # export CUDA_VERSION=118 # for CUDA 11.8 uv pip install vllm==0.9.1 --torch-backend=cu${CUDA_VERSION} pip install -e . ``` Then, update the `chat_config.backend` field in your `model_configs.yaml` config file: ```yaml chat_config: backend: vllm ``` --- ## Using **transformers** as the Inference Backend (Optional) > **Supporting CUDA 12.4/12.1** ```bash conda create -n MonkeyOCR python=3.10 conda activate MonkeyOCR git clone https://github.com/Yuliang-Liu/MonkeyOCR.git cd MonkeyOCR pip install -e . ``` Install PyTorch according to your CUDA version: ```bash export CUDA_VERSION=124 # for CUDA 12.4 # export CUDA_VERSION=121 # for CUDA 12.1 # Install pytorch pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu${CUDA_VERSION} ``` Install Flash Attention 2: ```bash pip install flash-attn==2.7.4.post1 --no-build-isolation ``` Then, update the `chat_config` in your `model_configs.yaml` config file: ```yaml chat_config: backend: transformers batch_size: 10 # Adjust based on your available GPU memory ``` --- ## File: docs/install_cuda_pp.md # Install with CUDA Support This guide walks you through setting up the environment for **MonkeyOCR** with CUDA support. You can choose **one** of the backends — **LMDeploy** (recomend), **vLLM**, or **transformers** — to install and use. It covers installation instructions for each of them. ## Step 1. Install PaddleX To use `PP-DocLayoutV2`, you must install two additional core libraries, **PaddlePaddle** and **PaddleX**. Make sure your pytorch version is compatible with the PaddlePaddle version you are installing, referring to the official **[PaddleX](https://github.com/PaddlePaddle/PaddleX)** ```bash conda create -n MonkeyOCR python=3.10 conda activate MonkeyOCR git clone https://github.com/Yuliang-Liu/MonkeyOCR.git cd MonkeyOCR export CUDA_VERSION=126 # for CUDA 12.6 # export CUDA_VERSION=118 # for CUDA 11.8 pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu${CUDA_VERSION}/ pip install paddlex[base]==3.3.0 pip install langchain==0.3.26 ``` ## Step 2. Install Inference Backend > **Note:** Based on our internal test, inference speed ranking is: **[LMDeploy](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/docs/install_cuda.md#using-lmdeploy-as-the-inference-backend-optional) ≥ [vLLM](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/docs/install_cuda.md#using-vllm-as-the-inference-backend-optional) >>> [transformers](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/docs/install_cuda.md#using-transformers-as-the-inference-backend-optional)** ### Using **LMDeploy** as the Inference Backend (Recommend) > **Supporting CUDA 12.6/11.8** ```bash # Install PyTorch. Refer to https://pytorch.org/get-started/previous-versions/ for version compatibility pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu${CUDA_VERSION} pip install -e . # CUDA 12.6 pip install lmdeploy==0.9.2 # CUDA 11.8 # pip install https://github.com/InternLM/lmdeploy/releases/download/v0.9.2/lmdeploy-0.9.2+cu118-cp310-cp310-manylinux2014_x86_64.whl --extra-index-url https://download.pytorch.org/whl/cu118 ``` > [!IMPORTANT] > #### Fixing the **Shared Memory Error** on **20/30/40 series / V100 ...** GPUs (Optional) > > Our 3B model runs smoothly on the NVIDIA RTX 30/40 series. However, when using **LMDeploy** as the inference backend, you might run into compatibility issues on these GPUs — typically this error: > > ``` > triton.runtime.errors.OutOfResources: out of resource: shared memory > ``` > > To resolve this issue, apply the following patch: > > ```bash > python tools/lmdeploy_patcher.py patch > ``` > **Note:** This command modifies LMDeploy’s source code in your environment. > To undo the changes, simply run: > > ```bash > python tools/lmdeploy_patcher.py restore > ``` > > Based on our tests on the **NVIDIA RTX 3090**, inference speed was **0.338 pages/second** using **LMDeploy** (with the patch applied), compared to only **0.015 pages/second** using **transformers**. > > **Special thanks to [@pineking](https://github.com/pineking) for the solution!** --- ### Using **vLLM** as the Inference Backend (Optional) > **Supporting CUDA 12.6/11.8** ```bash pip install uv --upgrade uv pip install vllm==0.9.1 --torch-backend=cu${CUDA_VERSION} pip install -e . ``` Then, update the `chat_config.backend` field in your `model_configs.yaml` config file: ```yaml chat_config: backend: vllm ``` --- ### Using **transformers** as the Inference Backend (Optional) > **Supporting CUDA 12.6** Install PyTorch and Flash Attention 2: ```bash # Install PyTorch. Refer to https://pytorch.org/get-started/previous-versions/ for version compatibility pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu126 pip install -e . pip install flash-attn==2.7.4.post1 --no-build-isolation ``` Then, update the `chat_config` in your `model_configs.yaml` config file: ```yaml chat_config: backend: transformers batch_size: 10 # Adjust based on your available GPU memory ``` --- ## File: docs/install_paddlex.md # PP-DocLayout_plus-L Usage Guide We have added support for the [PP-DocLayout_plus-L](https://huggingface.co/PaddlePaddle/PP-DocLayout_plus-L) model, which offers improved performance over `doclayout_yolo`. This guide will walk you through the necessary steps to use the new model. ## How to Use ### **1. Install Dependencies** To use `PP-DocLayout_plus-L`, you must install two additional core libraries, **PaddlePaddle** and **PaddleX**, on top of the project's base environment (from `requirements.txt`). **Step 1: Install PaddlePaddle** Please choose the command that corresponds to your **NVIDIA driver version** to install the GPU-accelerated version. Make sure your pytorch version is compatible with the PaddlePaddle version you are installing. ```bash # gpu,requires GPU driver version ≥450.80.02 (Linux) or ≥452.39 (Windows) python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ # gpu,requires GPU driver version ≥550.54.14 (Linux) or ≥550.54.14 (Windows) python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/ ``` **Step 2: Install PaddleX** Execute the following command to install the base version of PaddleX. ```bash pip install "paddlex[base]" ``` > [!NOTE] > > If the installation methods above are not suitable for your environment, or if you wish to explore more options, please refer to the official **[PaddleX](https://github.com/PaddlePaddle/PaddleX)**. ### **2. Modify the Configuration File** Update the `model` field in the [`model_configs.yaml`](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/model_configs.yaml#L7) file at the project root to `PP-DocLayout_plus-L`. ```yaml layout_config: model: PP-DocLayout_plus-L # PP-DocLayout_plus-L / doclayout_yolo ``` > [!TIP] > > Model weights will be automatically downloaded to the default HuggingFace path the first time you run the program. > > To manually download and store PP-DocLayout_plus-L weight files in your configured models_dir directory, execute the following procedure: > > 1. Download PP-DocLayout_plus-L weights to your local `models_dir` directory (link: [ModelScope](https://modelscope.cn/models/PaddlePaddle/PP-DocLayout_plus-L),[HuggingFace](https://huggingface.co/PaddlePaddle/PP-DocLayout_plus-L)) > 2. Add the following configuration to your [`model_configs.yaml`](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/model_configs.yaml) file: > ```yaml > weights: > PP-DocLayout_plus-L: Structure/PP-DocLayout_plus-L # The relative path of models_dir > > layout_config: > model: PP-DocLayout_plus-L # PP-DocLayout_plus-L / doclayout_yolo > ``` --- ## File: docs/Quantization.md # Quantization with AWQ 1. Install the required packages. ```bash pip install datasets ``` 2. If you directly proceed to the third step, you may encounter the following problems: ```bash RuntimeError: Currently, quantification and calibration of Qwen2_5_VLTextModel are not supported. The supported model types are InternLMForCausalLM, InternLM2ForCausalLM, InternLM3ForCausalLM, QWenLMHeadModel, Qwen2ForCausalLM, Qwen3ForCausalLM, BaiChuanForCausalLM, BaichuanForCausalLM, LlamaForCausalLM, LlavaLlamaForCausalLM,MGMLlamaForCausalLM, InternLMXComposer2ForCausalLM, Phi3ForCausalLM, ChatGLMForConditionalGeneration, MixtralForCausalLM, Qwen2VLForConditionalGeneration, Qwen2_5_VLForConditionalGeneration, MistralForCausalLM. ``` This is because in the calibrte.py file of the lmdeploy library, the following code (lines 255-258) replaces `model` with `vl_model.language_model`, causing `model_type` to become `Qwen2_5_VLTextModel` instead of the supported `Qwen2_5_VLForConditionalGeneration`: ``` if hasattr(vl_model, 'language_model'): # deepseek-vl, ... model = vl_model.language_model if hasattr(vl_model, 'llm'): # MiniCPMV, ... model = vl_model.llm ``` Find these codes and comment out these lines: ``` # if hasattr(vl_model, 'language_model'): # deepseek-vl, ... # model = vl_model.language_model # if hasattr(vl_model, 'llm'): # MiniCPMV, ... # model = vl_model.llm ``` You can use the following command to view the directory of the **lmdeploy** library: ```bash python -c "import lmdeploy; import os; print(os.path.dirname(lmdeploy.__file__))" ``` The relative location of calibrte.py is in **lmdeploy/lite/apis/calibrate.py** Or you can download [tools/fix_qwen2_5_vl_awq.py](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/tools/fix_qwen2_5_vl_awq.py) Run in your environment: ```bash python tools/fix_qwen2_5_vl_awq.py patch ``` **Note**: This command modifies LMDeploy’s source code in your environment. To undo the changes, simply run: ```bash python tools/fix_qwen2_5_vl_awq.py restore ``` 4. Enter the following in the terminal. ```bash lmdeploy lite auto_awq \ ./model_weight/Recognition \ --calib-dataset 'ptb' \ --calib-samples 64 \ --calib-seqlen 1024 \ --w-bits 4 \ --w-group-size 128 \ --batch-size 1 \ --work-dir ./monkeyocr_quantization ``` Wait for the quantization to complete. * If the quantization process is killed, you need to check if you have sufficient memory. * For reference, the maximum VRAM usage for quantization with these parameters is approximately 6.47GB. 5. You might encounter the following error: ``` RuntimeError: Error(s) in loading state_dict for Linear: size mismatch for bias: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([1280]). ``` This is because your installed version of LMDeploy is not yet compatible with Qwen2.5VL. You need to install the latest development version from the GitHub repository. ```bash pip install git+https://github.com/InternLM/lmdeploy.git ``` After the installation is complete, try quantizing again. 6. After quantization is complete, replace the `Recognition` folder. ```bash mv model_weight/Recognition Recognition_backup mv monkeyocr_quantization model_weight/Recognition ``` Then, you can try running the program again. --- ## File: docs/windows_support.md # Windows Support For Windows users, we provide three methods to run MonkeyOCR: 1. Natively on Windows 2. Using Windows Subsystem for Linux (WSL) 3. Using WSL with Docker ## Native Windows Support Follow the [installation guide](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/docs/install_cuda.md#install-with-cuda-support) to set up your environment. Download our model from Huggingface. ```python pip install huggingface_hub python tools/download_model.py ``` You can also download our model from ModelScope. ```python pip install modelscope python tools/download_model.py -t modelscope ``` Copy and run the following command. ``` pip install -U "triton-windows<3.4" ``` Then you can run MonkeyOCR normally. ## Running with WSL2 Or WSL2 + Docker Desktop ## Installing WSL2 First, ensure your version of Windows supports WSL2. 1. Enable WSL. Launch PowerShell with administrator privileges. * Enable the Virtual Machine Platform feature. ```PowerShell dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart ``` * Enable the Windows Subsystem for Linux feature. ```PowerShell dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart ``` * Restart your computer. 2. Install a Linux distribution. ```PowerShell wsl --install -d Ubuntu ``` 3. Download Docker Desktop. [Official Docker Website](https://www.docker.com/products/docker-desktop/) 4. Configure WSL config (Optional). If you need to quantize the model later, you might encounter issues with insufficient memory. * Open your user profile folder. * Enter `%UserProfile%` in the File Explorer address bar and press Enter. * Create a `.wslconfig` file. * Edit the file content with a code editor. ```.wslconfig [wsl2] memory=24GB ``` Other parameters can be set as needed. 5. Enter WSL. ```PowerShell wsl cd ~ ``` If you are only using the WSL method, after you enter the WSL terminal and have installed conda, you can then follow the [installation guide](https://github.com/Yuliang-Liu/MonkeyOCR/blob/main/docs/install_cuda.md#install-with-cuda-support) to set up your environment. ## Building the Container 1. Run Docker Desktop. 2. Enter WSL. ```PowerShell wsl cd ~ ``` 3. Clone the repository. ```PowerShell git clone https://github.com/Yuliang-Liu/MonkeyOCR cd MonkeyOCR ``` 4. Follow the 'Docker Deployment' section in the [README.md](../README.md) file to create the Docker image. After entering the container, you can run MonkeyOCR normally. You can use the `Dev Containers extension` in VS Code to connect to the container for convenient editing and modification. If you encounter the error `RuntimeError: No enough gpu memory for runtime.`, it indicates insufficient VRAM. You can try quantizing the model. For details, see [Quantization Method](Quantization.md).