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
Instructions to use SayBitekhan/dots.ocr-vllm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SayBitekhan/dots.ocr-vllm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SayBitekhan/dots.ocr-vllm", 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)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SayBitekhan/dots.ocr-vllm", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SayBitekhan/dots.ocr-vllm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SayBitekhan/dots.ocr-vllm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SayBitekhan/dots.ocr-vllm", "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/SayBitekhan/dots.ocr-vllm
- SGLang
How to use SayBitekhan/dots.ocr-vllm 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 "SayBitekhan/dots.ocr-vllm" \ --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": "SayBitekhan/dots.ocr-vllm", "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 "SayBitekhan/dots.ocr-vllm" \ --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": "SayBitekhan/dots.ocr-vllm", "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 SayBitekhan/dots.ocr-vllm with Docker Model Runner:
docker model run hf.co/SayBitekhan/dots.ocr-vllm
| { | |
| "architectures": [ | |
| "DotsOCRForCausalLM" | |
| ], | |
| "model_type": "dots_ocr", | |
| "auto_map": { | |
| "AutoConfig": "configuration_dots.DotsOCRConfig", | |
| "AutoModelForCausalLM": "modeling_dots_ocr.DotsOCRForCausalLM" | |
| }, | |
| "attention_bias": true, | |
| "attention_dropout": 0.0, | |
| "hidden_act": "silu", | |
| "hidden_size": 1536, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 8960, | |
| "max_position_embeddings": 131072, | |
| "max_window_layers": 28, | |
| "num_attention_heads": 12, | |
| "num_hidden_layers": 28, | |
| "num_key_value_heads": 2, | |
| "rms_norm_eps": 1e-06, | |
| "rope_scaling": null, | |
| "rope_theta": 1000000, | |
| "sliding_window": 131072, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.51.0", | |
| "use_cache": true, | |
| "use_sliding_window": false, | |
| "vocab_size": 151936, | |
| "image_token_id": 151665, | |
| "video_token_id": 151656, | |
| "vision_config": { | |
| "embed_dim": 1536, | |
| "hidden_size": 1536, | |
| "intermediate_size": 4224, | |
| "num_hidden_layers": 42, | |
| "num_attention_heads": 12, | |
| "num_channels": 3, | |
| "patch_size": 14, | |
| "post_norm": true, | |
| "rms_norm_eps": 1e-05, | |
| "spatial_merge_size": 2, | |
| "temporal_patch_size": 1, | |
| "use_bias": false, | |
| "attn_implementation": "flash_attention_2", | |
| "init_merger_std": 0.02, | |
| "initializer_range": 0.02, | |
| "is_causal": false | |
| } | |
| } |