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")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/trocr-small-printed") model = AutoModelForMultimodalLM.from_pretrained("microsoft/trocr-small-printed", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit History
-
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())}
Verified signaturef9cfe12
-
Adding `safetensors` variant of this model (#4)
Verified signature- Adding `safetensors` variant of this model (cc0ea333b6c5c7ab74648821278beb285f2a08be) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>04e994a -
Update preprocessor_config.json
Verified signature099d540 -
Update preprocessor_config.json (#6)
Verified signature- Update preprocessor_config.json (f66a5bdbe646b6f4964cf0563bfb7dd4ed87aa48) Co-authored-by: Rohit <rohit5895@users.noreply.huggingface.co>ed2c07d
-
Adding generation config file(s)
e6eff16
-
Update README.md
03f95be
-
Update README.md (#1)
- Update README.md (a7ef5527234fd69ee74a2edb741184d9aa31b25c) Co-authored-by: Loïck BOURDOIS <lbourdois@users.noreply.huggingface.co>1afd9f0
-
Update code example
34306f7
-
Update from Minghao Li
Minghao Li25fe3e3 -
initial commit
41f69fa