Downloads · 30 days
2
13% of all-time downloads
ananya03/tf_model_malyalam
tf_model_malyalam is a machine learning model from ananya03. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
2
13% of all-time downloads
All-time downloads
16
Public
Repo size
459 MB
Likes
0
Public
Click a slice to open those files.
.h5230 MB · 100%
From the Hugging Face model README
from transformers import AutoTokenizer, TFAutoModelForSeq2SeqLM
model_checkpoint="Helsinki-NLP/opus-mt-en-ml"
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
model = TFAutoModelForSeq2SeqLM.from_pretrained("ananya03/tf_model_malyalam")
input_text = "Wishing you all a very good morning"
tokenized = tokenizer([input_text], return_tensors='np') # Convert input text to numerical format first
out = model.generate(**tokenized, max_length=128) # Performs translation
# Translated text from the translation code
with tokenizer.as_target_tokenizer():
translated_text = tokenizer.decode(out[0], skip_special_tokens=True)
print(translated_text)