This model is a fine-tuned version of
facebook/nllb-200-distilled-1.3B for translating
Ancient Greek to
Modern Greek.
This model was trained by Spyridon Mavromatis at the Institute for Language and Speech Processing (ILSP), "Athena" RC, and the National and Kapodistrian University of Athens (NKUA) as part of an M.Sc. thesis.
-
Base Model: facebook/nllb-200-distilled-1.3B
-
Method: LoRA (Rank=16, Alpha=32)
-
Vocabulary: Expanded with 148 Polytonic Greek characters.
-
Training Data: ~130k sentence pairs from the AG-MG Corpus.
You need to load the base model, resize the embeddings, and then load the Peft adapter. If you want to load the base model in 8-bit you need bitsandbytes installed.
1import torch
2from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3from peft import PeftModel
4
5adapter_repo = "ilsp/nllb-200-1.3B-ag-mg-lora"
6base_model_id = "facebook/nllb-200-distilled-1.3B"
7
8# 1. Load Tokenizer
9tokenizer = AutoTokenizer.from_pretrained(adapter_repo, src_lang="ell_Grek")
10
11# 2. Load Base Model (using 8-bit loading if resources are limited)
12# Note: Requires `bitsandbytes` installed
13model = AutoModelForSeq2SeqLM.from_pretrained(
14 base_model_id,
15 device_map="auto",
16 load_in_8bit=True
17)
18
19# 3. Resize Embeddings
20model.resize_token_embeddings(len(tokenizer))
21
22# 4. Load Adapter
23model = PeftModel.from_pretrained(model, adapter_repo)
24
25# 5. Translate
26text = "Ὦ ξεῖν', ἀγγέλλειν Λακεδαιμονίοις ὅτι τῇδε κείμεθα."
27inputs = tokenizer(text, return_tensors="pt").to(model.device)
28
29target_lang_id = tokenizer.convert_tokens_to_ids("ell_Grek")
30
31tokens = model.generate(
32 **inputs,
33 forced_bos_token_id=target_lang_id
34)
35
36print(tokenizer.decode(tokens[0], skip_special_tokens=True))
Evaluated on the 2,000 sentence-pairs Test Set (Attic & Koine Hellenistic dialects).
Evaluated on the 250 sentence-pairs Stress Set (Ionic, Doric, Homeric dialects).
1@inproceedings{mavromatis-etal-2026-ancient,
2 title = {Ancient Greek to Modern Greek Machine Translation: A Novel Benchmark and Fine-Tuning Experiments on LLMs and NMT Models},
3 author = {Mavromatis, Spyridon and Sofianopoulos, Sokratis and Prokopidis, Prokopis and Giagkou, Maria},
4 booktitle = {Proceedings of the Fifteenth Language Resources and Evaluation Conference (LREC 2026)},
5 month = {May},
6 year = {2026},
7 pages = {8685--8698},
8 address = {Palma, Mallorca, Spain},
9 publisher = {European Language Resources Association (ELRA)},
10 editor = {Piperidis, Stelios and Bel, Núria and van den Heuvel, Henk and Ide, Nancy and Krek, Simon and Toral, Antonio},
11 doi = {10.63317/4cdk64dgm2w9}
12}