Text Generation
Transformers
Safetensors
Norwegian Nynorsk
Norwegian
t5gemma2
text2text-generation
norwegian
nynorsk
morphology
normform
🇪🇺 Region: EU
Instructions to use NbAiLab/normform-nynorsk-multitask with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NbAiLab/normform-nynorsk-multitask with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NbAiLab/normform-nynorsk-multitask")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("NbAiLab/normform-nynorsk-multitask") model = AutoModelForMultimodalLM.from_pretrained("NbAiLab/normform-nynorsk-multitask", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NbAiLab/normform-nynorsk-multitask with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NbAiLab/normform-nynorsk-multitask" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NbAiLab/normform-nynorsk-multitask", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NbAiLab/normform-nynorsk-multitask
- SGLang
How to use NbAiLab/normform-nynorsk-multitask 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 "NbAiLab/normform-nynorsk-multitask" \ --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": "NbAiLab/normform-nynorsk-multitask", "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 "NbAiLab/normform-nynorsk-multitask" \ --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": "NbAiLab/normform-nynorsk-multitask", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NbAiLab/normform-nynorsk-multitask with Docker Model Runner:
docker model run hf.co/NbAiLab/normform-nynorsk-multitask
NormForm Nynorsk Two-Task Model (NbAiLab/normform-nynorsk-multitask)
Experimental Release (
v0.1): Part of the NormForm toolkit for context-aware Norwegian morphological standardization, alternative generation, and sub-norm consistency auditing.
This two-task T5Gemma2 sequence-to-sequence model handles:
create_morphological_alternatives:— Expands Norwegian Nynorsk sentences into contextually valid[alt1|alt2]morphological alternative lattices while preserving all non-alternative text byte-for-byte.skriv_i_samme_morfologiske_stil:— Resolves[alt1|alt2]morphological lattices into a consistent target sub-norm style conditioned on steering prompt words.
Quick Start with normform
Install the normform package (which wraps this model with strict Template.align lattice validation and the official reviewed NbAiLab/normform-nynorsk-nasjonalbiblioteknorm style cache):
pip install normform
# Standardize Nynorsk text using Nasjonalbiblioteknorm:
normform standardize -t "Me ønskjer å bruke den første søndagen til å gjere dette." --lang nno --style nasjonalbiblioteknorm
# -> Vi ynskjer å bruka den fyrste sundagen til å gjera dette.
# Generate [alt1|alt2] morphological alternative brackets:
normform alternatives -t "Me ønskjer å bruke den første søndagen." --lang nno
# Audit a document for internal sub-norm inconsistencies:
normform audit -i manuscript_nno.txt --lang nno --raw
Python API
from normform import Standardizer
std = Standardizer(lang="nno", style="nasjonalbiblioteknorm")
print(std("Me ønskjer å bruke den første søndagen til å gjere dette."))
# -> "Vi ynskjer å bruka den fyrste sundagen til å gjera dette."
Model Provenance
- Selected Checkpoint:
checkpoint-19052from the pinned Nynorsk two-task training run (training manifest SHA-256:bda1108ce308f19811dc040f44c8ad8f127a673c74524c1103c8151059b2282b). - Validation & Test Scores: Constrained validation score
0.967486; constrained sealed-test score0.963089(seenormform_provenance.jsonfor full checksums). - Official Companion Style Cache:
NbAiLab/normform-nynorsk-nasjonalbiblioteknorm
- Downloads last month
- 139