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
Update config.json
#2
by ydshieh HF Staff - opened
- config.json +1 -0
config.json
CHANGED
|
@@ -150,6 +150,7 @@
|
|
| 150 |
},
|
| 151 |
"is_encoder_decoder": true,
|
| 152 |
"model_type": "vision-encoder-decoder",
|
|
|
|
| 153 |
"tie_word_embeddings": false,
|
| 154 |
"torch_dtype": "float32",
|
| 155 |
"transformers_version": null
|
|
|
|
| 150 |
},
|
| 151 |
"is_encoder_decoder": true,
|
| 152 |
"model_type": "vision-encoder-decoder",
|
| 153 |
+
"processor_class": "TrOCRProcessor",
|
| 154 |
"tie_word_embeddings": false,
|
| 155 |
"torch_dtype": "float32",
|
| 156 |
"transformers_version": null
|