Attention Is All You Need
Paper • 1706.03762 • Published • 135
How to use sachin18449/hindi-english-unigram-nmt with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("sachin18449/hindi-english-unigram-nmt", device_map="auto")This model is a Transformer-based Neural Machine Translation (NMT) model trained to translate English sentences into Hindi using Unigram tokenization.
It was trained from scratch using Hugging Face Transformers.
This sequence-to-sequence model uses a standard Encoder–Decoder Transformer architecture for English→Hindi translation.
It is trained with Unigram tokenization instead of BPE to improve rare word handling and morphological coverage.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "sachin18449/hindi-english-unigram-nmt"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
text = "How are you?"
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))