Upload nllb.py
Browse files1234567891011121314151617181920212223242526import sysimport time
sr= sys.argv[1]tr=sys.argv[2]from transformers import pipelinetext= "I am callig from the tax office"#text= "أنا من مكتب الضرائب"#ARB#text="Sono di ufficio fiscale." #ITA #text="Aku berhubung dari kantor pajak." #IND#text="Soy un agente de impuestos."#SPA#text="Tôi gọi từ văn phòng thuế"#VIE#text="저는 세금청에서 왔습니다."#KOR
translator = pipeline(task="translation", model="nllb",src_lang=sr,tgt_lang=tr)translation = translator(text)[0]['translation_text']print(translation)
#arb_Arab #eng_Latn#ita_Latn#ind_Latn#spa_Latn#vie_Latn#kor_Hangnllb.pyAdded+26