Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

sbhavy
/
donut-base-ocr

Image-Text-to-Text
Transformers
PyTorch
TensorBoard
vision-encoder-decoder
Generated from Trainer
Model card Files Files and versions
xet
Metrics Training metrics Community
1

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

  • Libraries
  • Transformers

    How to use sbhavy/donut-base-ocr with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("image-text-to-text", model="sbhavy/donut-base-ocr")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForMultimodalLM
    
    tokenizer = AutoTokenizer.from_pretrained("sbhavy/donut-base-ocr")
    model = AutoModelForMultimodalLM.from_pretrained("sbhavy/donut-base-ocr")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • vLLM

    How to use sbhavy/donut-base-ocr with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "sbhavy/donut-base-ocr"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "sbhavy/donut-base-ocr",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/sbhavy/donut-base-ocr
  • SGLang

    How to use sbhavy/donut-base-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 "sbhavy/donut-base-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": "sbhavy/donut-base-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 "sbhavy/donut-base-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": "sbhavy/donut-base-ocr",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use sbhavy/donut-base-ocr with Docker Model Runner:

    docker model run hf.co/sbhavy/donut-base-ocr
donut-base-ocr / runs
155 kB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 7 commits
sbhavy's picture
sbhavy
End of training
8817ee8 about 3 years ago
  • May13_18-50-20_6575e849f4b0
    End of training about 3 years ago
  • May14_05-08-25_c9078daac211
    End of training about 3 years ago
  • May26_16-11-13_e6352949b7c3
    End of training about 3 years ago
  • May26_17-14-07_1465e872ce98
    End of training about 3 years ago
  • May27_13-09-57_18a3a12723b7
    End of training about 3 years ago
  • May27_15-18-23_608f40e247da
    End of training about 3 years ago
  • May27_15-31-16_608f40e247da
    End of training about 3 years ago
  • May27_16-25-10_92a47e0f4e7c
    End of training about 3 years ago