YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
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)
- Downloads last month
- 70