Image-Text-to-Text
Safetensors
Transformers
English
Chinese
multilingual
dots_ocr
text-generation
image-to-text
ocr
document-parse
layout
table
formula
custom_code
conversational
Eval Results
Instructions to use dots-studio/dots.ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dots-studio/dots.ocr with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="dots-studio/dots.ocr", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("dots-studio/dots.ocr", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dots-studio/dots.ocr with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dots-studio/dots.ocr" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dots-studio/dots.ocr", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/dots-studio/dots.ocr
- SGLang
How to use dots-studio/dots.ocr with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dots-studio/dots.ocr" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dots-studio/dots.ocr", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "dots-studio/dots.ocr" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dots-studio/dots.ocr", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use dots-studio/dots.ocr with Docker Model Runner:
docker model run hf.co/dots-studio/dots.ocr
Commit History
-
fix recursion, None Type of min_pixels & max_pixels, and enforced bf16 on SM75 and lower devices
Verified signatureaa609e3
-
Upload configuration_dots.py with huggingface_hub
Verified signatureba670c5 -
Upload configuration_dots.py with huggingface_hub
Verified signatureb09554e -
fix autoprocessor (#30)
Verified signature- fix auto map (e5ceb7cb83dcd8e5d37d109af5744e9d97e88fa4) Co-authored-by: Dongdong Kuang <kingsley01@users.noreply.huggingface.co>6b68a58
-
Adding `transformers` as a library, and also mentioning the `custom_code` tag (#29)
Verified signature- Adding `transformers` as a library, and also mentioning the `custom_code` tag (9becf2f563569f966f1825ef59e0f0a3b46e56c1) Co-authored-by: Aritra Roy Gosthipaty <ariG23498@users.noreply.huggingface.co>89eabff
-
Update VisionSdpaAttention to support memory efficient backend. (#27)
Verified signature- Update VisionSdpaAttention to support memory efficient backend. (fc8b0b11b92c381639e616506cca574f1b05af09) Co-authored-by: warren wang <warrenwjk@users.noreply.huggingface.co>4d84cbc
-
Update modeling_dots_vision.py (#19)
Verified signature- Update modeling_dots_vision.py (a455edb59a10ff47d298fd2ab6b3fcf53417b42a) Co-authored-by: chen.jian <chenj123@users.noreply.huggingface.co>325ed02
-
Upload dots.ocr LICENSE AGREEMENT with huggingface_hub
Verified signaturee315fc3
-
Upload NOTICE with huggingface_hub
Verified signaturebb6e753 -
Update modeling_dots_ocr_vllm.py (#7)
Verified signature- Update modeling_dots_ocr_vllm.py (67cbf202a8f58ec138797afa24090a392d608c1e) - Update modeling_dots_ocr_vllm.py (4bc8bca53381124acd4bf63f4567b515539b3c7f) Co-authored-by: Renjie Wu <RenjieWu@users.noreply.huggingface.co>bb9eb0e
-
Upload modeling_dots_vision.py with huggingface_hub
Verified signature42f4178
-
Upload README.md with huggingface_hub
Verified signaturef984833 -
Upload README.md with huggingface_hub
Verified signature3d2aea7
-
Upload README.md with huggingface_hub
Verified signatureebfa26a -
Upload README.md with huggingface_hub
Verified signatureaaccbca -
Upload folder using huggingface_hub
Verified signaturee1cb4af -
initial commit
Verified signature7638595