Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

strangervisionhf
/
dots.ocr-base-fix

Image-Text-to-Text
Transformers
Safetensors
PyTorch
English
dots_ocr
text-generation
text-generation-inference
OCR
VLM
Markdown
conversational
custom_code
Model card Files Files and versions
xet
Community
1

Instructions to use strangervisionhf/dots.ocr-base-fix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use strangervisionhf/dots.ocr-base-fix with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("image-text-to-text", model="strangervisionhf/dots.ocr-base-fix", 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("strangervisionhf/dots.ocr-base-fix", trust_remote_code=True, dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use strangervisionhf/dots.ocr-base-fix with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "strangervisionhf/dots.ocr-base-fix"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "strangervisionhf/dots.ocr-base-fix",
    		"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/strangervisionhf/dots.ocr-base-fix
  • SGLang

    How to use strangervisionhf/dots.ocr-base-fix 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 "strangervisionhf/dots.ocr-base-fix" \
        --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": "strangervisionhf/dots.ocr-base-fix",
    		"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 "strangervisionhf/dots.ocr-base-fix" \
            --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": "strangervisionhf/dots.ocr-base-fix",
    		"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 strangervisionhf/dots.ocr-base-fix with Docker Model Runner:

    docker model run hf.co/strangervisionhf/dots.ocr-base-fix
dots.ocr-base-fix
6.09 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 22 commits
prithivMLmods's picture
prithivMLmods
Update README.md
f036a7c verified 6 months ago
  • .gitattributes
    1.52 kB
    initial commit 7 months ago
  • README.md
    11.1 kB
    Update README.md 6 months ago
  • chat_template.json
    1.11 kB
    upload model 7 months ago
  • config.json
    1.52 kB
    upload model 7 months ago
  • configuration_dots.py
    3.09 kB
    update config (Adding the Attributes) (#1) 7 months ago
  • generation_config.json
    81 Bytes
    upload model 7 months ago
  • merges.txt
    1.82 MB
    upload model 7 months ago
  • model-00001-of-00002.safetensors
    4.29 GB
    xet
    upload model 7 months ago
  • model-00002-of-00002.safetensors
    1.79 GB
    xet
    upload model 7 months ago
  • model.safetensors.index.json
    52.9 kB
    upload model 7 months ago
  • modeling_dots_ocr.py
    5.11 kB
    upload model 7 months ago
  • modeling_dots_ocr_vllm.py
    18 kB
    upload model 7 months ago
  • modeling_dots_vision.py
    20.6 kB
    upload model 7 months ago
  • preprocessor_config.json
    454 Bytes
    upload model 7 months ago
  • special_tokens_map.json
    519 Bytes
    upload model 7 months ago
  • tokenizer.json
    7.34 MB
    upload model 7 months ago
  • tokenizer_config.json
    9.7 kB
    upload model 7 months ago
  • vocab.json
    2.78 MB
    upload model 7 months ago