This model is a fine-tuned version of
facebook/nllb-200-distilled-600M 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-600M
-
Method: LoRA (Rank=16, Alpha=32, Dropout=0.05)
-
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.
1
2import torch
3
4from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
5
6from peft import PeftModel
7
8# 1. Load Tokenizer (from THIS repo to get the added tokens)
9
10adapter_repo = "ilsp/nllb-200-600M-ag-mg-lora"
11
12tokenizer = AutoTokenizer.from_pretrained(adapter_repo, src_lang="ell_Grek")
13
14# 2. Load Base Model
15
16base_model_id = "facebook/nllb-200-distilled-600M"
17
18model = AutoModelForSeq2SeqLM.from_pretrained(base_model_id, device_map="auto")
19
20# 3. Resize Embeddings (CRITICAL: prevents size mismatch error)
21
22model.resize_token_embeddings(len(tokenizer))
23
24# 4. Load LoRA Adapter
25
26model = PeftModel.from_pretrained(model, adapter_repo)
27
28model.eval()
29
30# 5. Inference
31
32text = "Ὦ ξεῖν', ἀγγέλλειν Λακεδαιμονίοις ὅτι τῇδε κείμεθα."
33
34inputs = tokenizer(text, return_tensors="pt").to(model.device)
35
36# We force the target language to be Modern Greek ("ell_Grek")
37
38target_lang_id = tokenizer.convert_tokens_to_ids("ell_Grek")
39
40translated_tokens = model.generate(
41
42 **inputs,
43
44 forced_bos_token_id=target_lang_id,
45
46 max_length=100
47
48)
49
50print(tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0])
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}