Instructions to use microsoft/trocr-base-stage1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/trocr-base-stage1 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-stage1")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/trocr-base-stage1") model = AutoModelForMultimodalLM.from_pretrained("microsoft/trocr-base-stage1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
CER exploding
#4
by davaa33 - opened
hello Im trying to finetune TrOCR for Mongolian Traditional Script and updated its tokenizer with SentencePiece tokenizer and started finetuning and after 1-4 Epochs depending on learning it starts to produce repeat tokens and CER just Explodes am I doing something wrong or is it just nature of a model ?
davaa33 changed discussion status to closed
if this is happening to you , lower your Transformer's version