Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

Riksarkivet
/
trocr-base-handwritten-hist-swe-2

Image-to-Text
HTRflow
TensorBoard
Safetensors
Transformers
Swedish
vision-encoder-decoder
image-text-to-text
trocr
swedish lion libre
htr
swedish
historical
handwriting
Model card Files Files and versions
xet
Metrics Training metrics Community

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
trocr-base-handwritten-hist-swe-2
1.55 GB
Ctrl+K
Ctrl+K
  • 4 contributors
History: 17 commits
viklofg's picture
viklofg
Update README.md
aa79fcb verified 10 days ago
  • tensorboard
    Upload 21 files almost 2 years ago
  • .gitattributes
    1.52 kB
    initial commit almost 2 years ago
  • README.md
    13.4 kB
    Update README.md 10 days ago
  • config.json
    4.81 kB
    initial model and processor upload almost 2 years ago
  • generation_config.json
    274 Bytes
    initial model and processor upload almost 2 years ago
  • handler.py
    1.67 kB
    Update handler.py over 1 year ago
  • merges.txt
    456 kB
    initial model and processor upload almost 2 years ago
  • model.safetensors
    1.54 GB
    xet
    initial model and processor upload almost 2 years ago
  • preprocessor_config.json
    364 Bytes
    initial model and processor upload almost 2 years ago
  • special_tokens_map.json
    957 Bytes
    initial model and processor upload almost 2 years ago
  • tokenizer.json
    2.11 MB
    initial model and processor upload almost 2 years ago
  • tokenizer_config.json
    1.25 kB
    initial model and processor upload almost 2 years ago
  • vocab.json
    798 kB
    initial model and processor upload almost 2 years ago