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
Update preprocessor_config.json
#9
by rohit5895 - opened
Got this warning while running.
Could not find image processor class in the image processor config or the model config. Loading based on pattern matching with the model's feature extractor configuration. Please open a PR/issue to update preprocessor_config.json to use image_processor_type instead of feature_extractor_type. This warning will be removed in v4.40.
rohit5895 changed pull request status to closed
rohit5895 changed pull request status to open
rohit5895 changed pull request status to closed
rohit5895 changed pull request status to open
Thanks, it's now fixed!
nielsr changed pull request status to closed