opus-mt model finetuned on ai4bhart Hindi-English parallel corpora (SAMANANTAR)

source-language: Hindi

target-language: English



from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("salesken/translation-hi-en")
model = AutoModelForSeq2SeqLM.from_pretrained("salesken/translation-hi-en")

hin_snippet = "कोविड के कारण हमने अपने ऋण ब्याज को कम कर दिया है"
inputs = tokenizer.encode(
    hin_snippet, return_tensors="pt",padding=True,max_length=512,truncation=True)

outputs = model.generate(
    inputs, max_length=128, num_beams=None, early_stopping=True)

translated = tokenizer.decode(outputs[0]).replace('<pad>',"").strip().lower()
print(translated)
# due to covid, we have reduced our debt interest

New

Select AutoNLP in the “Train” menu to fine-tune this model automatically.

Downloads last month
902
Hosted inference API
Translation
This model can be loaded on the Inference API on-demand.