Instructions to use Sprakbanken/norhand-hcr-beta1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sprakbanken/norhand-hcr-beta1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Sprakbanken/norhand-hcr-beta1")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Sprakbanken/norhand-hcr-beta1") model = AutoModelForMultimodalLM.from_pretrained("Sprakbanken/norhand-hcr-beta1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sprakbanken/norhand-hcr-beta1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sprakbanken/norhand-hcr-beta1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sprakbanken/norhand-hcr-beta1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Sprakbanken/norhand-hcr-beta1
- SGLang
How to use Sprakbanken/norhand-hcr-beta1 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 "Sprakbanken/norhand-hcr-beta1" \ --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": "Sprakbanken/norhand-hcr-beta1", "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 "Sprakbanken/norhand-hcr-beta1" \ --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": "Sprakbanken/norhand-hcr-beta1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Sprakbanken/norhand-hcr-beta1 with Docker Model Runner:
docker model run hf.co/Sprakbanken/norhand-hcr-beta1
norhand-hcr-beta1
This model is a fine-tuned version of microsoft/trocr-base-stage1 on the NorHand dataset. It achieves the following results on the evaluation set:
- Loss: 1.4687
- Cer: 0.0439
It achieves the following results on the test set:
- CER: 8.3
- WER: 22.07
This is work in progress.
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 32
- eval_batch_size: 1
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 2000
- num_epochs: 10
Training results
| Training Loss | Epoch | Step | Validation Loss | Cer |
|---|---|---|---|---|
| 0.7606 | 0.71 | 5000 | 1.0489 | 0.1266 |
| 0.5971 | 1.43 | 10000 | 1.2096 | 0.1028 |
| 0.4448 | 2.14 | 15000 | 1.3738 | 0.0771 |
| 0.3919 | 2.85 | 20000 | 1.2733 | 0.0670 |
| 0.2806 | 3.56 | 25000 | 1.3048 | 0.0597 |
| 0.2055 | 4.28 | 30000 | 1.3568 | 0.0557 |
| 0.2486 | 4.99 | 35000 | 0.9717 | 0.0527 |
| 0.1631 | 5.7 | 40000 | 1.3159 | 0.0506 |
| 0.1159 | 6.41 | 45000 | 1.3730 | 0.0480 |
| 0.0605 | 7.13 | 50000 | 1.3399 | 0.0469 |
| 0.0626 | 7.84 | 55000 | 1.3642 | 0.0460 |
| 0.0532 | 8.55 | 60000 | 1.3870 | 0.0450 |
| 0.0177 | 9.26 | 65000 | 1.4912 | 0.0439 |
| 0.0308 | 9.98 | 70000 | 1.4687 | 0.0439 |
Framework versions
- Transformers 4.32.1
- Pytorch 2.1.1+cu121
- Datasets 2.15.0
- Tokenizers 0.13.3
- Downloads last month
- 11
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 1 Ask for provider support
Model tree for Sprakbanken/norhand-hcr-beta1
Base model
microsoft/trocr-base-stage1