Downloads · 30 days
37
0% of all-time downloads
ltg/normistral-11b-translate
normistral-11b-translate is a text generation model from ltg. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
37
0% of all-time downloads
All-time downloads
8.6K
Public
Parameters
11.4B
45.7 GB on disk
Likes
1
Public
Click a slice to open those files.
.bin22.9 GB · 50%
From the Hugging Face model README

NorMistral-11b-translate is a finetuned machine-translation version of NorMistral-11b-long. It can translate sentences or documents in all 6 directions between Norwegian Bokmål, Nynorsk and English.
We release the model under Apache 2.0 license to indicate that we do not impose any additional constraints on the model weights. However, we do not own the data in the training collection.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
# load the NorMistral tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("norallm/normistral-11b-translate")
model = AutoModelForCausalLM.from_pretrained(
"norallm/normistral-11b-translate",
device_map='auto',
torch_dtype=torch.bfloat16
)
# create a conversation and convert it to token indices using the NorMistral chat template
messages = [
{"role": "system", "content": "nynorsk"}, # Optional message to set the target language for translation; "engelsk" by default, "bokmål" and "nynorsk" are supported
{"role": "user", "content": "Hva er hovedstaden i Norge?"}
]
input_tokens = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
# run the generation (customizable via the various parameters)
output_tokens = model.generate(
input_tokens,
max_new_tokens=2048, # limit max number of generated tokens
do_sample=False # do not randomly sample the outputs
)
# decode the generated tokens back to text; should return "Kva er hovudstaden i Noreg?"
output_str = tokenizer.decode(output_tokens[0, input_tokens.size(1):], skip_special_tokens=True).strip()
The full training corpus is published as ltg/nob-nno-eng-translation-pairs.
David Samuel ([email protected])
@inproceedings{samuel-etal-2025-small,
title = "Small Languages, Big Models: {A} Study of Continual Training on Languages of {Norway}",
author = "Samuel, David and
Mikhailov, Vladislav and
Velldal, Erik and
{\O}vrelid, Lilja and
Charpentier, Lucas Georges Gabriel and
Kutuzov, Andrey and
Oepen, Stephan",
editor = "Johansson, Richard and
Stymne, Sara",
booktitle = "Proceedings of the Joint 25th Nordic Conference on Computational Linguistics and 11th Baltic Conference on Human Language Technologies (NoDaLiDa/Baltic-HLT 2025)",
month = mar,
year = "2025",
address = "Tallinn, Estonia",
publisher = "University of Tartu Library",
url = "https://aclanthology.org/2025.nodalida-1.61/",
pages = "573--608",
ISBN = "978-9908-53-109-0",
}