Image-Text-to-Text
Transformers
Safetensors
multilingual
unlimited-ocr
feature-extraction
baidu
vision-language
ocr
custom_code
Instructions to use VECTORVV1/READ-PRO-OCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VECTORVV1/READ-PRO-OCR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="VECTORVV1/READ-PRO-OCR", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("VECTORVV1/READ-PRO-OCR", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use VECTORVV1/READ-PRO-OCR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VECTORVV1/READ-PRO-OCR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VECTORVV1/READ-PRO-OCR", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/VECTORVV1/READ-PRO-OCR
- SGLang
How to use VECTORVV1/READ-PRO-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 "VECTORVV1/READ-PRO-OCR" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VECTORVV1/READ-PRO-OCR", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "VECTORVV1/READ-PRO-OCR" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VECTORVV1/READ-PRO-OCR", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use VECTORVV1/READ-PRO-OCR with Docker Model Runner:
docker model run hf.co/VECTORVV1/READ-PRO-OCR
| { | |
| "_name_or_path": "Unlimited-OCR", | |
| "candidate_resolutions": [ | |
| [ | |
| 1024, | |
| 1024 | |
| ] | |
| ], | |
| "global_view_pos": "head", | |
| "architectures": [ | |
| "UnlimitedOCRForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "modeling_unlimitedocr.UnlimitedOCRConfig", | |
| "AutoModel": "modeling_unlimitedocr.UnlimitedOCRForCausalLM" | |
| }, | |
| "language_config": { | |
| "architectures": [ | |
| "DeepseekOCRForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_deepseekv2.DeepseekV2Config", | |
| "AutoModel": "modeling_deepseek.DeepseekV2Model", | |
| "AutoModelForCausalLM": "modeling_deepseek.DeepseekV2ForCausalLM" | |
| }, | |
| "bos_token_id": 0, | |
| "eos_token_id": 1, | |
| "first_k_dense_replace": 1, | |
| "hidden_size": 1280, | |
| "intermediate_size": 6848, | |
| "kv_lora_rank": null, | |
| "lm_head": true, | |
| "max_position_embeddings": 32768, | |
| "moe_intermediate_size": 896, | |
| "n_group": 1, | |
| "n_routed_experts": 64, | |
| "n_shared_experts": 2, | |
| "num_attention_heads": 10, | |
| "num_experts_per_tok": 6, | |
| "num_hidden_layers": 12, | |
| "num_key_value_heads": 10, | |
| "q_lora_rank": null, | |
| "qk_nope_head_dim": 0, | |
| "qk_rope_head_dim": 0, | |
| "rm_head": false, | |
| "topk_group": 1, | |
| "topk_method": "greedy", | |
| "torch_dtype": "bfloat16", | |
| "use_mla": false, | |
| "v_head_dim": 128, | |
| "vocab_size": 129280, | |
| "sliding_window_size": 128 | |
| }, | |
| "model_type": "unlimited-ocr", | |
| "projector_config": { | |
| "input_dim": 2048, | |
| "model_type": "mlp_projector", | |
| "n_embed": 1280, | |
| "projector_type": "linear" | |
| }, | |
| "tile_tag": "2D", | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.46.3", | |
| "vision_config": { | |
| "image_size": 1024, | |
| "mlp_ratio": 3.7362, | |
| "model_name": "deeplip_b_l", | |
| "model_type": "vision", | |
| "width": { | |
| "clip-l-14-224": { | |
| "heads": 16, | |
| "image_size": 224, | |
| "layers": 24, | |
| "patch_size": 14, | |
| "width": 1024 | |
| }, | |
| "sam_vit_b": { | |
| "downsample_channels": [ | |
| 512, | |
| 1024 | |
| ], | |
| "global_attn_indexes": [ | |
| 2, | |
| 5, | |
| 8, | |
| 11 | |
| ], | |
| "heads": 12, | |
| "layers": 12, | |
| "width": 768 | |
| } | |
| } | |
| }, | |
| "bos_token_id": 0, | |
| "eos_token_id": 1, | |
| "first_k_dense_replace": 1, | |
| "hidden_size": 1280, | |
| "intermediate_size": 6848, | |
| "kv_lora_rank": null, | |
| "lm_head": true, | |
| "max_position_embeddings": 32768, | |
| "moe_intermediate_size": 896, | |
| "n_group": 1, | |
| "n_routed_experts": 64, | |
| "n_shared_experts": 2, | |
| "num_attention_heads": 10, | |
| "num_experts_per_tok": 6, | |
| "num_hidden_layers": 12, | |
| "num_key_value_heads": 10, | |
| "q_lora_rank": null, | |
| "qk_nope_head_dim": 0, | |
| "qk_rope_head_dim": 0, | |
| "rm_head": false, | |
| "topk_group": 1, | |
| "topk_method": "greedy", | |
| "use_mla": false, | |
| "v_head_dim": 128, | |
| "vocab_size": 129280, | |
| "sliding_window_size": 128, | |
| "sliding_window": 128 | |
| } |