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

  • Log In
  • Sign Up

microsoft
/
trocr-base-printed

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

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

  • Libraries
  • Transformers

    How to use microsoft/trocr-base-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-base-printed")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForImageTextToText
    
    tokenizer = AutoTokenizer.from_pretrained("microsoft/trocr-base-printed")
    model = AutoModelForImageTextToText.from_pretrained("microsoft/trocr-base-printed")
  • Notebooks
  • Google Colab
  • Kaggle
trocr-base-printed
2.67 GB
Ctrl+K
Ctrl+K
  • 5 contributors
History: 14 commits
nielsr's picture
nielsr HF Staff
SFconvertbot's picture
SFconvertbot
Adding `safetensors` variant of this model (#7)
93450be verified almost 2 years ago
  • .gitattributes
    1.23 kB
    Adding `safetensors` variant of this model (#7) almost 2 years ago
  • README.md
    2.98 kB
    Update README.md over 3 years ago
  • config.json
    4.13 kB
    Rename encoder_hidden_size to cross_attention_hidden_size over 4 years ago
  • generation_config.json
    190 Bytes
    Adding generation config file(s) over 3 years ago
  • merges.txt
    456 kB
    First commit over 4 years ago
  • model.safetensors
    1.33 GB
    xet
    Adding `safetensors` variant of this model (#7) almost 2 years ago
  • preprocessor_config.json
    224 Bytes
    Update preprocessor_config.json almost 2 years ago
  • pytorch_model.bin

    Detected Pickle imports (3)

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

    What is a pickle import?

    1.33 GB
    xet
    First commit over 4 years ago
  • special_tokens_map.json
    772 Bytes
    First commit over 4 years ago
  • tokenizer_config.json
    1.12 kB
    Remove tokenizer_file over 4 years ago
  • vocab.json
    899 kB
    First commit over 4 years ago