Image-to-Text
HTRflow
TensorBoard
Safetensors
Transformers
Swedish
vision-encoder-decoder
image-text-to-text
trocr
swedish lion libre
htr
swedish
historical
handwriting
Instructions to use Riksarkivet/trocr-base-handwritten-hist-swe-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- HTRflow
How to use Riksarkivet/trocr-base-handwritten-hist-swe-2 with HTRflow:
# CLI usage # see docs: https://ai-riksarkivet.github.io/htrflow/latest/getting_started/quick_start.html htrflow pipeline <path/to/pipeline.yaml> <path/to/image>
# Python usage from htrflow.pipeline.pipeline import Pipeline from htrflow.pipeline.steps import Task from htrflow.models.framework.model import ModelClass pipeline = Pipeline( [ Task( ModelClass, {"model": "Riksarkivet/trocr-base-handwritten-hist-swe-2"}, {} ), ]) - Transformers
How to use Riksarkivet/trocr-base-handwritten-hist-swe-2 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="Riksarkivet/trocr-base-handwritten-hist-swe-2")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Riksarkivet/trocr-base-handwritten-hist-swe-2") model = AutoModelForMultimodalLM.from_pretrained("Riksarkivet/trocr-base-handwritten-hist-swe-2") - Notebooks
- Google Colab
- Kaggle
Ctrl+K