Instructions to use qantev/trocr-small-spanish with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qantev/trocr-small-spanish 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="qantev/trocr-small-spanish")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("qantev/trocr-small-spanish") model = AutoModelForImageTextToText.from_pretrained("qantev/trocr-small-spanish") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -90,6 +90,19 @@ generated_ids = model.generate(pixel_values)
|
|
| 90 |
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 91 |
```
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
# Contact us
|
| 94 |
|
| 95 |
research [at] qantev [dot] com
|
|
|
|
| 90 |
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 91 |
```
|
| 92 |
|
| 93 |
+
## Citation
|
| 94 |
+
```
|
| 95 |
+
@misc{lauar2024spanishtrocrleveragingtransfer,
|
| 96 |
+
title={Spanish TrOCR: Leveraging Transfer Learning for Language Adaptation},
|
| 97 |
+
author={Filipe Lauar and Valentin Laurent},
|
| 98 |
+
year={2024},
|
| 99 |
+
eprint={2407.06950},
|
| 100 |
+
archivePrefix={arXiv},
|
| 101 |
+
primaryClass={cs.AI},
|
| 102 |
+
url={https://arxiv.org/abs/2407.06950},
|
| 103 |
+
}
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
# Contact us
|
| 107 |
|
| 108 |
research [at] qantev [dot] com
|