Unlimited-OCR: Kaggle setup and memory fixes
Learn to test Unlimited-OCR on Kaggle with one T4 GPU, an 8K token window, and workarounds for out-of-memory errors.
Player not loading? Watch on YouTube
This tutorial runs Unlimited-OCR in a Kaggle notebook. The speaker describes a 3 billion parameter model released in BFloat16 and recommends vLLM for a multiple-GPU or cloud GPU setup, with an OpenAI API-compatible endpoint and a context window of 32,768 tokens. The Kaggle route is an experiment; the source description warns that it is neither production grade nor highly accurate.
The walkthrough selects Kaggle's GPU T4 2 accelerator and enables internet access, but uses only the first GPU, CUDA 0. It installs PyTorch, TorchVision, Transformers and Pillow, then downloads the model and creates an output folder. The example uses JPEG images. The speaker discusses PyMuPDF for PDF input but does not demonstrate that path.
Inference starts with an image URL and an 8K token window. A memory-clearing helper attempts to limit out-of-memory errors. Further steps include restarting the session and reducing maximum length, base size and image size. The demonstrated output includes an images folder, result.md with extracted text, and an image with bounding boxes.
Disabling crop mode lets a later example run, but the speaker points out substantial hallucination in its text. He also reports little success using both GPUs and recommends renting a GPU for further work.