Skip to page content
SAVRN
Search Plan a project

Open-weight model · Image to text

trocr-base-handwritten-hist-swe-2

by Swedish National Archives, AI-lab and Data Services Riksarkivet/trocr-base-handwritten-hist-swe-2

trocr-base-handwritten-hist-swe-2 is an open-weight model for image to text from Swedish National Archives, AI-lab and Data Services, released under Apache License 2.0. It has 385M parameters. At 16-bit it needs about 0.9 GB of GPU memory, which fits on 1x MI300X from $1.85 an hour, at the lowest prices in the SAVRN Index. It draws 98.1k downloads a month.

An HTR model for historical Swedish developed by the Swedish National Archives in collaboration with the Stockholm City Archives, the Finnish National Archives and Jämtlands Fornskriftsällskap.

Parameters385M
Context—
Weights1.5 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads98.1k

Runs On

What it takes to serve trocr-base-handwritten-hist-swe-2 (385M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.8 GB 0.9 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.4 GB 0.5 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.2 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Oct 16, 2026.

trocr-base-handwritten-hist-swe-2 on every accelerator the SAVRN Index prices, at every precision

Model Card

By Swedish National Archives, AI-lab and Data Services, published under apache-2.0, revision aa79fcb1850b.

Swedish Lion Libre

An HTR model for historical Swedish developed by the Swedish National Archives in collaboration with the Stockholm City Archives, the Finnish National Archives and Jämtlands Fornskriftsällskap. The model is trained on Swedish handwriting from the period 1600-1900.

Model Details

Model Description

  • Developed by: The Swedish National Archives
  • Model type: TrOCR base handwritten
  • Language(s) (NLP): Historical Swedish handwriting
  • License: apache-2.0
  • Finetuned from model: trocr-base-handwritten

Uses

The model is trained on Swedish running-text handwriting dating from the start of the 17th century to the end of the 19th century. Like most current HTR models it operates on a text-line level, so its intended use is within an HTR pipeline that segments the text into text lines, which are transcribed by the model.

Direct Use

Read the full model card (1,178 words)

Configuration

Architecture
VisionEncoderDecoderModel
Vocabulary size
50,265
Stored precision
float32
Model type
vision-encoder-decoder

Identity and Version

Repository
Riksarkivet/trocr-base-handwritten-hist-swe-2
Publisher
Swedish National Archives, AI-lab and Data Services
Task
Image to text
Modality
Image and text
Library
htrflow
Parameters
385M parameters
Languages
sv
Revision
aa79fcb1850bf3155ebc442570d6c6bfc0ac8100
First published
2024-08-15
Last updated
2026-06-04

Files and Weights

33 files, 1.5 GB in total. The weights are 1 file totalling 1.5 GB in safetensors.

Weights1 file · 1.5 GB
Configuration5 files · 8.1 KB
Tokenizer4 files · 3.4 MB
Documentation1 file · 13.4 KB
Other21 files · 4.1 MB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights1.5 GB 786c378f820e
config.jsonConfiguration4.8 KB —
generation_config.jsonConfiguration274 B —
handler.pyConfiguration1.7 KB —
preprocessor_config.jsonConfiguration364 B —
special_tokens_map.jsonConfiguration957 B —
README.mdDocumentation13.4 KB —
tensorboard/events.out.tfevents.1722593667.amlpai05.1105181.0Other3.9 MB e81f5466e797
tensorboard/events.out.tfevents.1723193022.amlpai05.965322.0Other9.3 KB da74c58ec00e
tensorboard/events.out.tfevents.1723193194.amlpai05.973492.0Other9.3 KB 6f99a604119a
tensorboard/events.out.tfevents.1723193342.amlpai05.981268.0Other9.3 KB a586b1a3f265
tensorboard/events.out.tfevents.1723193372.amlpai05.983438.0Other9.3 KB fd93fbe7d0e8
tensorboard/events.out.tfevents.1723193535.amlpai05.991824.0Other9.3 KB cc62b59f3f8c
tensorboard/events.out.tfevents.1723194050.amlpai05.1009717.0Other9.3 KB de37725d9546
tensorboard/events.out.tfevents.1723194523.amlpai05.1023845.0Other9.3 KB e734c7ada0fc
tensorboard/events.out.tfevents.1723195508.amlpai05.1058286.0Other9.3 KB bfbcada98187
tensorboard/events.out.tfevents.1723195753.amlpai05.1067357.0Other9.3 KB aef606f1453e
tensorboard/events.out.tfevents.1723196150.amlpai05.1081045.0Other9.3 KB 847ba958ca06
tensorboard/events.out.tfevents.1723196403.amlpai05.1089190.0Other9.3 KB 751f004889ba
tensorboard/events.out.tfevents.1723198169.amlpai05.1144588.0Other9.3 KB c4edf1a1d6b5
tensorboard/events.out.tfevents.1723198290.amlpai05.1149345.0Other9.3 KB 5fae89f13545
tensorboard/events.out.tfevents.1723198390.amlpai05.1153837.0Other9.3 KB 6482f55a9c61
tensorboard/events.out.tfevents.1723198574.amlpai05.1160632.0Other9.3 KB c76729f530da
tensorboard/events.out.tfevents.1723198651.amlpai05.1165918.0Other9.3 KB b14f2323fe6d
tensorboard/events.out.tfevents.1723198808.amlpai05.1174133.0Other9.3 KB d054323f5586
tensorboard/events.out.tfevents.1723198845.amlpai05.1176198.0Other9.3 KB 3a19baa0b765
tensorboard/events.out.tfevents.1723198913.amlpai05.1179428.0Other9.3 KB 737c1974ec08
tensorboard/events.out.tfevents.1723198936.amlpai05.1181588.0Other9.3 KB d269e3a8f8bc
.gitattributesRepository1.5 KB —
merges.txtTokenizer456.3 KB —
tokenizer.jsonTokenizer2.1 MB —
tokenizer_config.jsonTokenizer1.3 KB —
vocab.jsonTokenizer798.3 KB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
1.5 GB
Download from Swedish National Archives, AI-lab and Data Services

Released by Swedish National Archives, AI-lab and Data Services through its official repository on Hugging Face. Read the license.

Built From

  • Derived from microsoft/trocr-base-handwritten
  • Described by arXiv:2109.10282
  • Trained on (disclosed) Riksarkivet/alvsborgs_losen_lines
  • Trained on (disclosed) Riksarkivet/bergmastaren_i_nora_htr_lines
  • Trained on (disclosed) Riksarkivet/bergskollegium_relationer_och_skrivelser_lines
  • Trained on (disclosed) Riksarkivet/carl_fredrik_pahlmans_resejournaler_lines
  • Trained on (disclosed) Riksarkivet/frihetstidens_utskottshandlingar_lines
  • Trained on (disclosed) Riksarkivet/gota_hovratt_lines
  • Trained on (disclosed) Riksarkivet/goteborgs_poliskammare_fore_1900_lines
  • Trained on (disclosed) Riksarkivet/jonkopings_radhusratt_och_magistrat_lines
  • Trained on (disclosed) Riksarkivet/krigshovrattens_dombocker_lines
  • Trained on (disclosed) Riksarkivet/svea_hovratt_lines
  • Trained on (disclosed) Riksarkivet/trolldomskommissionen_lines

Memory Requirements

PrecisionWeights in memory
As published1.5 GB
16-bit0.8 GB
8-bit0.4 GB
4-bit0.2 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About trocr-base-handwritten-hist-swe-2

How much GPU memory does trocr-base-handwritten-hist-swe-2 need?

About 0.9 GB at 16-bit and 0.2 GB at 4-bit: the weights (385M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run trocr-base-handwritten-hist-swe-2 on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use trocr-base-handwritten-hist-swe-2 commercially?

Yes. trocr-base-handwritten-hist-swe-2 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Image to text

nougat-base

AI at Meta

Nougat model trained on PDF-to-markdown. It was introduced in the paper Nougat: Neural Optical Understanding for Academic Documents by Blecher et al. and first released in this repository. Disclaimer: The team releasing Nougat did not write a model card for this model so this model card has been written by the Hugging Face team. Note: this model corresponds to the "0.1.0-base" version of the original repository. Nougat is a Donut model trained to transcribe scientific PDFs into an easy-to-use markdown format. The model consists of a Swin Transformer as vision encoder, and an mBART model as text decoder. The model is trained to autoregressively predict the markdown given only the pixels of…

Open weights cc-by-nc-4.0 349M parameters transformers

Model · Image to text

trocr-base-printed

Microsoft

TrOCR model fine-tuned on the SROIE dataset. It was introduced in the paper TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models by Li et al. and first released in this repository. Disclaimer: The team releasing TrOCR did not write a model card for this model so this model card has been written by the Hugging Face team. The TrOCR model is an encoder-decoder model, consisting of an image Transformer as encoder, and a text Transformer as decoder. The image encoder was initialized from the weights of BEiT, while the text decoder was initialized from the weights of RoBERTa. Images are presented to the model as a sequence of fixed-size patches (resolution 16x16), which…

Open weights 333M parameters transformers

Model · Image to text

trocr-base-handwritten

Microsoft

TrOCR model fine-tuned on the IAM dataset. It was introduced in the paper TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models by Li et al. and first released in this repository. Disclaimer: The team releasing TrOCR did not write a model card for this model so this model card has been written by the Hugging Face team. The TrOCR model is an encoder-decoder model, consisting of an image Transformer as encoder, and a text Transformer as decoder. The image encoder was initialized from the weights of BEiT, while the text decoder was initialized from the weights of RoBERTa. Images are presented to the model as a sequence of fixed-size patches (resolution 16x16), which…

Open weights mit 333M parameters transformers

captioning pretrained on COCO dataset - base architecture (with ViT large backbone). Authors from the paper write in the abstract: Vision-Language Pre-training (VLP) has advanced the performance for many vision-language tasks. However, most existing pre-trained models only excel in either understanding-based tasks or generation-based tasks. Furthermore, performance improvement has been largely achieved by scaling up the dataset with noisy image-text pairs collected from the web, which is a suboptimal source of supervision. In this paper, we propose BLIP, a new VLP framework which transfers flexibly to both vision-language understanding and generation tasks. BLIP effectively utilizes the…

Open weights bsd-3-clause 470M parameters 512 tokens transformers

Model · Image to text

pix2struct-base

Google

This model is the pretrained version of Pix2Struct, use this model for fine-tuning purposes only. Pix2Struct is an image encoder - text decoder model that is trained on image-text pairs for various tasks, including image captionning and visual question answering. The full list of available models can be found on the Table 1 of the paper: The abstract of the model states that: forms. Perhaps due to this diversity, previous work has typically relied on domainspecific recipes with limited sharing of the underlying data, model architectures, and objectives. We present Pix2Struct, a pretrained image-to-text model for purely visual language understanding, which can be finetuned on tasks…

Open weights apache-2.0 282M parameters transformers

Modelo experimental de extracción estructurada, sin OCR explícito, para imágenes de boletas peruanas. Es una adaptación de bajo recurso de naver-clova-ix/donut-base-finetuned-cord-v2, no un modelo entrenado desde cero. El modelo recibe una imagen completa y genera una representación que DonutProcessor.token2json convierte al siguiente esquema: Este checkpoint está pensado para investigación, demostraciones y prototipos supervisados sobre boletas impresas peruanas en español. Puede servir como punto de partida para nuevas evaluaciones o fine-tuning con datos propios. No debe utilizarse sin revisión humana para contabilidad, tributación, auditoría, pagos, cumplimiento normativo ni otras…

Open weights mit 201M parameters transformers