Instructions to use microsoft/trocr-large-printed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/trocr-large-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-large-printed")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/trocr-large-printed") model = AutoModelForMultimodalLM.from_pretrained("microsoft/trocr-large-printed", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Rename encoder_hidden_size to cross_attention_hidden_size
Browse files- config.json +2 -2
config.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
| 23 |
"do_sample": false,
|
| 24 |
"dropout": 0.1,
|
| 25 |
"early_stopping": false,
|
| 26 |
-
"
|
| 27 |
"encoder_no_repeat_ngram_size": 0,
|
| 28 |
"eos_token_id": 2,
|
| 29 |
"finetuning_task": null,
|
|
@@ -90,7 +90,7 @@
|
|
| 90 |
"diversity_penalty": 0.0,
|
| 91 |
"do_sample": false,
|
| 92 |
"early_stopping": false,
|
| 93 |
-
"
|
| 94 |
"encoder_no_repeat_ngram_size": 0,
|
| 95 |
"eos_token_id": null,
|
| 96 |
"finetuning_task": null,
|
|
|
|
| 23 |
"do_sample": false,
|
| 24 |
"dropout": 0.1,
|
| 25 |
"early_stopping": false,
|
| 26 |
+
"cross_attention_hidden_size": 1024,
|
| 27 |
"encoder_no_repeat_ngram_size": 0,
|
| 28 |
"eos_token_id": 2,
|
| 29 |
"finetuning_task": null,
|
|
|
|
| 90 |
"diversity_penalty": 0.0,
|
| 91 |
"do_sample": false,
|
| 92 |
"early_stopping": false,
|
| 93 |
+
"cross_attention_hidden_size": null,
|
| 94 |
"encoder_no_repeat_ngram_size": 0,
|
| 95 |
"eos_token_id": null,
|
| 96 |
"finetuning_task": null,
|