Instructions to use microsoft/trocr-base-handwritten with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/trocr-base-handwritten 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-handwritten")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("microsoft/trocr-base-handwritten") model = AutoModelForImageTextToText.from_pretrained("microsoft/trocr-base-handwritten") - Notebooks
- Google Colab
- Kaggle
TrOCR deployment in production
#6
by CristianJD - opened
Hi, anyone know how to make the inferece time using TrOCR fastest as possible, i deploy it using docker in Openshift but it's too low, i already using ONNIX format but i can't do a quantizing , because is not implemented yet in Vision-Encoder-Decoder
Hi, I also tried using an ONNX format but was not met with much luck with making inference faster. Using an Nvidia A10, I can get inference down to ~120ms but that's still too slow for my use case. Did you happen to find anything since quantization does not seem to work for me neither?