File size: 409 Bytes
a7c894d
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
## loading translation model

from transformers import pipeline

model_id = "drrobot9/nllb-ig-yo-ha-finetuned"

translator = pipeline("translation", model=model_id, device=-1)

if __name__ == "__main__":
    test_text = "Kedu ihe ị na-eme?"
    translation = translator(test_text, src_lang="ibo_Latn", tgt_lang="eng_Latn")
    print("Test Translation (Igbo -> English):", translation[0]['translation_text'])