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")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("dh-unibe/trocr-kurrent-XVI-XVII") model = AutoModelForImageTextToText.from_pretrained("dh-unibe/trocr-kurrent-XVI-XVII") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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.
- Downloads last month
- 694