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
New discussion
Resources
  • PR & discussions documentation
  • Code of Conduct
  • Hub documentation

ValueError: Unrecognized feature extractor in microsoft/trocr-base-handwritten. Should have a `feature_extractor_type` key in its preprocessor_config.json of config.json, or one of the following `model_type` keys in its {CONFIG_NAME}: {', '.join(c for c in FEATURE_EXTRACTOR_MAPPING_NAMES.keys())}

1
#7 opened almost 2 years ago by
ram1813

Example links broken

#5 opened over 2 years ago by
Xenova

why 'microsoft/trocr-small-printed' don't have vocab.json?

👍 1
4
#3 opened over 3 years ago by
yaop

Convertation to TorchScript

1
#2 opened almost 4 years ago by
terekhinI
Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs