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
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

ademax
/
trocr-small

Image-Text-to-Text
Transformers
ONNX
Safetensors
vision-encoder-decoder
Model card Files Files and versions
xet
Community
1

Instructions to use ademax/trocr-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use ademax/trocr-small with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("image-text-to-text", model="ademax/trocr-small")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForImageTextToText
    
    tokenizer = AutoTokenizer.from_pretrained("ademax/trocr-small")
    model = AutoModelForImageTextToText.from_pretrained("ademax/trocr-small")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use ademax/trocr-small with vLLM:

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

    How to use ademax/trocr-small 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 "ademax/trocr-small" \
        --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": "ademax/trocr-small",
    		"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 "ademax/trocr-small" \
            --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": "ademax/trocr-small",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use ademax/trocr-small with Docker Model Runner:

    docker model run hf.co/ademax/trocr-small
trocr-small
278 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 6 commits
hieunguyen1053's picture
hieunguyen1053
Upload ort_config.json with huggingface_hub
52ae460 over 2 years ago
  • .gitattributes
    1.52 kB
    initial commit over 2 years ago
  • added_tokens.json
    27 Bytes
    Upload processor over 2 years ago
  • config.json
    4.67 kB
    Upload model over 2 years ago
  • decoder_model_quantized.onnx
    33.1 MB
    xet
    Upload decoder_model_quantized.onnx with huggingface_hub over 2 years ago
  • encoder_model_quantized.onnx
    23.1 MB
    xet
    Upload encoder_model_quantized.onnx with huggingface_hub over 2 years ago
  • generation_config.json
    185 Bytes
    Upload model over 2 years ago
  • merges.txt
    440 kB
    Upload processor over 2 years ago
  • model.safetensors
    218 MB
    xet
    Upload model over 2 years ago
  • ort_config.json
    831 Bytes
    Upload ort_config.json with huggingface_hub over 2 years ago
  • preprocessor_config.json
    504 Bytes
    Upload processor over 2 years ago
  • special_tokens_map.json
    468 Bytes
    Upload processor over 2 years ago
  • tokenizer.json
    2.07 MB
    Upload processor over 2 years ago
  • tokenizer_config.json
    735 Bytes
    Upload processor over 2 years ago
  • vocab.json
    781 kB
    Upload processor over 2 years ago