Attention Is All You Need
Paper • 1706.03762 • Published • 135
How to use sachin18449/hindi-english-wordpiece-nmt with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("sachin18449/hindi-english-wordpiece-nmt", device_map="auto")This model is a custom Transformer-based neural machine translation (NMT) model trained to translate English sentences to Hindi.
It follows the original Attention Is All You Need architecture and has been fine-tuned on a parallel English-Hindi dataset.
This is a sequence-to-sequence model with an Encoder-Decoder Transformer architecture.
It is trained for English → Hindi machine translation using PyTorch and Hugging Face 🤗 Transformers.
transformers (no pre-trained checkpoint)The model can be used as-is for:
It can be further fine-tuned for:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "sachin18449/hindi-english-wordpiece-nmt"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
input_text = "How are you?"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))