16 lines
856 B
Python
16 lines
856 B
Python
# conda activate transformers
|
|
# conda install pip
|
|
# pip install https://github.com/huggingface/transformers/archive/nllb.zip -q
|
|
# pip install transformers
|
|
|
|
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
|
|
|
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
|
|
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
|
|
|
|
translator = pipeline('translation', model=model, tokenizer=tokenizer, src_lang="tam_Taml", tgt_lang='eng_Latn', max_length = 400)
|
|
translator("திஸ் ஐஸ் எ வெரி குட் மாடல் ")
|
|
|
|
# --------------------------------------------
|
|
https://colab.research.google.com/drive/1o9r0QbEQZ1tn4eBVv-wajAtgwi6Lp-ZJ?usp=sharing#scrollTo=q49lJjXd4Jct
|
|
https://colab.research.google.com/drive/1QEF0U9AaBeQdjLw7SyRty2ENAD4Qiiil#scrollTo=TFm232e77QRT |