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

  • Log In
  • Sign Up

microsoft
/
trocr-small-printed

Image-to-Text
Transformers
PyTorch
Safetensors
vision-encoder-decoder
image-text-to-text
trocr
Model card Files Files and versions
xet
Community
7

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

  • Libraries
  • Transformers

    How to use microsoft/trocr-small-printed with Transformers:

    # Use a pipeline as a high-level helper
    # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5.
    # You must load the model directly (see below) or downgrade to v4.x with:
    # 'pip install "transformers<5.0.0'
    from transformers import pipeline
    
    pipe = pipeline("image-to-text", model="microsoft/trocr-small-printed")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForImageTextToText
    
    tokenizer = AutoTokenizer.from_pretrained("microsoft/trocr-small-printed")
    model = AutoModelForImageTextToText.from_pretrained("microsoft/trocr-small-printed")
  • Notebooks
  • Google Colab
  • Kaggle
trocr-small-printed
493 MB
Ctrl+K
Ctrl+K
  • 7 contributors
History: 9 commits
nielsr's picture
nielsr HF Staff
SFconvertbot's picture
SFconvertbot
Adding `safetensors` variant of this model (#4)
04e994a verified almost 2 years ago
  • .gitattributes
    1.23 kB
    Adding `safetensors` variant of this model (#4) almost 2 years ago
  • README.md
    2.84 kB
    Update README.md over 3 years ago
  • config.json
    4.21 kB
    Update from Minghao Li over 4 years ago
  • generation_config.json
    190 Bytes
    Adding generation config file(s) over 3 years ago
  • model.safetensors
    246 MB
    xet
    Adding `safetensors` variant of this model (#4) almost 2 years ago
  • preprocessor_config.json
    272 Bytes
    Update preprocessor_config.json almost 2 years ago
  • pytorch_model.bin

    Detected Pickle imports (3)

    • "torch.FloatStorage",
    • "torch._utils._rebuild_tensor_v2",
    • "collections.OrderedDict"

    What is a pickle import?

    246 MB
    xet
    Update from Minghao Li over 4 years ago
  • sentencepiece.bpe.model
    1.36 MB
    xet
    Update from Minghao Li over 4 years ago
  • special_tokens_map.json
    238 Bytes
    Update from Minghao Li over 4 years ago
  • tokenizer_config.json
    327 Bytes
    Update from Minghao Li over 4 years ago