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
|
Download README.md from NbAiLab/normform-nynorsk-multitask: direct link, hf CLI and curl.
- Browser
- Download file 2.65 kB
-
https://huggingface.co/NbAiLab/normform-nynorsk-multitask/resolve/main/README.md
- Command line
-
hf download hf://NbAiLab/normform-nynorsk-multitask/README.md
-
curl -L -o README.md https://huggingface.co/NbAiLab/normform-nynorsk-multitask/resolve/main/README.md
2.65 kB
| language: | |
| - nn | |
| - no | |
| license: apache-2.0 | |
| library_name: transformers | |
| tags: | |
| - norwegian | |
| - nynorsk | |
| - morphology | |
| - normform | |
| - text2text-generation | |
| pipeline_tag: text-generation | |
| # NormForm Nynorsk Two-Task Model (`NbAiLab/normform-nynorsk-multitask`) | |
| > **Experimental Release (`v0.1`)**: Part of the [NormForm](https://github.com/NationalLibraryOfNorway/normform) toolkit for context-aware Norwegian morphological standardization, alternative generation, and sub-norm consistency auditing. | |
| This two-task `T5Gemma2` sequence-to-sequence model handles: | |
| 1. **`create_morphological_alternatives:`** — Expands Norwegian Nynorsk sentences into contextually valid `[alt1|alt2]` morphological alternative lattices while preserving all non-alternative text byte-for-byte. | |
| 2. **`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`](https://pypi.org/project/normform/) package (which wraps this model with strict `Template.align` lattice validation and the official reviewed [`NbAiLab/normform-nynorsk-nasjonalbiblioteknorm`](https://huggingface.co/datasets/NbAiLab/normform-nynorsk-nasjonalbiblioteknorm) style cache): | |
| ```bash | |
| 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 | |
| ```python | |
| 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-19052` from the pinned Nynorsk two-task training run (training manifest SHA-256: `bda1108ce308f19811dc040f44c8ad8f127a673c74524c1103c8151059b2282b`). | |
| - **Validation & Test Scores**: Constrained validation score `0.967486`; constrained sealed-test score `0.963089` (see `normform_provenance.json` for full checksums). | |
| - **Official Companion Style Cache**: [`NbAiLab/normform-nynorsk-nasjonalbiblioteknorm`](https://huggingface.co/datasets/NbAiLab/normform-nynorsk-nasjonalbiblioteknorm) | |