def language_translator(text):
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForSeq2SeqLM.from_pretrained("finetune-EN-to-Ta/")
# model = AutoModelForSeq2SeqLM.from_pretrained("finetune-EN-to-Ta/")
tokenized = tokenizer([text], return_tensors='pt')
out = model.generate(**tokenized, max_length=128)
with tokenizer.as_target_tokenizer():
return tokenizer.decode(out[0],skip_special_tokens=True)
text_to_translate = "How are you?"
output = language_translator(text_to_translate)
print(output)
- Downloads last month
- 7
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.