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")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/trocr-base-printed") model = AutoModelForMultimodalLM.from_pretrained("microsoft/trocr-base-printed", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit History
-
add AIBOM
Verified signatureDear model owner(s), We are a group of researchers investigating the usefulness of sharing AIBOMs (Artificial Intelligence Bill of Materials) to document AI models – AIBOMs are machine-readable structured lists of components (e.g., datasets and models) used to enhance transparency in AI-model supply chains. To pursue the above-mentioned objective, we identified popular models on HuggingFace and, based on your model card (and some configuration information available in HuggingFace), we generated your AIBOM according to the CyclonDX (v1.6) standard (see https://cyclonedx.org/docs/1.6/json/). AIBOMs are generated as JSON files by using the following open-source supporting tool: https://github.com/MSR4SBOM/ALOHA (technical details are available in the research paper: https://github.com/MSR4SBOM/ALOHA/blob/main/ALOHA.pdf). The JSON file in this pull request is your AIBOM (see https://github.com/MSR4SBOM/ALOHA/blob/main/documentation.json for details on its structure). Clearly, the subm…c540662
-
Adding `safetensors` variant of this model (#7)
Verified signature- Adding `safetensors` variant of this model (24216f24cd78fe1a9c8b4e6e4565aec5c9220e63) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>93450be -
Update preprocessor_config.json
Verified signature5cd6a54 -
Update preprocessor_config.json (#10)
Verified signature- Update preprocessor_config.json (d8a07658d30f42946ad9f1d1222d47bdbb5dfb51) Co-authored-by: Rohit <rohit5895@users.noreply.huggingface.co>618e2fd
-
Adding generation config file(s)
0c708d3
-
Update README.md
59889fe
-
Update README.md (#1)
- Update README.md (dde50d9ce4c629fd0004bfc4e1c9b5ef092a4fb3) Co-authored-by: Loïck BOURDOIS <lbourdois@users.noreply.huggingface.co>191a64d
-
Remove tokenizer_file
822aa45
-
Update code example
bc285bd
-
Add more appropriate image to code example
ba8ea5c -
Add trocr tag
eb7bf98
-
Rename encoder_hidden_size to cross_attention_hidden_size
11abf67 -
Add model card
7bbc2cb
-
First commit
5fecfdb -
initial commit
a8a4689