Run this model with HF Jobs
Run dh-unibe/trocr-kurrent-XVI-XVII on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/dh-unibe/trocr-kurrent-XVI-XVII. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/dh-unibe/trocr-kurrent-XVI-XVII on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/dh-unibe/trocr-kurrent-XVI-XVII. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/dh-unibe/trocr-kurrent-XVI-XVII. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use dh-unibe/trocr-kurrent-XVI-XVII with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dh-unibe/trocr-kurrent-XVI-XVII with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="dh-unibe/trocr-kurrent-XVI-XVII")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("dh-unibe/trocr-kurrent-XVI-XVII") model = AutoModelForMultimodalLM.from_pretrained("dh-unibe/trocr-kurrent-XVI-XVII", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dh-unibe/trocr-kurrent-XVI-XVII with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dh-unibe/trocr-kurrent-XVI-XVII" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dh-unibe/trocr-kurrent-XVI-XVII", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dh-unibe/trocr-kurrent-XVI-XVII
- SGLang
How to use dh-unibe/trocr-kurrent-XVI-XVII with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dh-unibe/trocr-kurrent-XVI-XVII" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dh-unibe/trocr-kurrent-XVI-XVII", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "dh-unibe/trocr-kurrent-XVI-XVII" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dh-unibe/trocr-kurrent-XVI-XVII", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dh-unibe/trocr-kurrent-XVI-XVII with Docker Model Runner:
docker model run hf.co/dh-unibe/trocr-kurrent-XVI-XVII
TrOCR Kurrent-Model 16th to 18th century
Handwritten Text Recognition model for 16th to 18th century German.
Part of the developments at the Digital Humanities@University of Bern. Developed by Jonas Widmer, Anna Funk, Christa Schneider, and Tobias Hodel.
Base model: dh-unibe/trocr-kurrent
Epochs: 19.85 / 20
Eval CER: 0.05673
Test CER: 0.05416
This model is based on an extensive training set (of roughly 1579200 words) and evaluated against the same hands in an evaluation and test set (automatic split). Consisting of German Kurrent scripts written in the 16th-18th century.
The ground truth stems from different projects and partners and is biased toward Swiss documents. It is based on documents from a variety of archives and projects. Among others, the State Archives of Zürich (Stillstandsprotokolle, Ratsmanuale, Findmittel), and the scholarly edition project Königsfelden (Universitäten Zürich und Bern: www.koenigsfelden.uzh.ch). As well as transcriptions from Einsiedeln. Further contributions by the university archives of Greifswald: https://rechtsprechung-im-ostseeraum.archiv.uni-greifswald.de/.
The public Transkribus model (based on PyLaia) can be found here: https://readcoop.eu/model/german-kurrent-16th-18th/
Extensive testing of the model has still to be carried out. This is only a first attempt but might help for fine-tuning tasks.
Input: one line, not a page
This is a VisionEncoderDecoderModel for line images: it reads one cropped
text line per call, which is also what the CER above was measured on. A whole
page is not an input it has — pass one and it returns a fragment of it.
Segment the page first (kraken, eScriptorium, Transkribus, or any line
segmenter) and pass the crops one at a time. In the DH Bern serving stack the
model is registered level: line and the gateway segments with kraken before
calling it; the reasoning and the measurements behind that rule are in
thodel/serving-atr-inference#165.
- Downloads last month
- 1,308