File size: 666 Bytes
956e2dd d29cb78 956e2dd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
cense: cc0-1.0
---
A model that translates English sentences to Marathi.
To use this model, use the following code:
```python
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
model_checkpoint = "sumanthmandavalli/english-to-marathi"
tokenizer = MBart50TokenizerFast.from_pretrained(model_checkpoint)
model = MBartForConditionalGeneration.from_pretrained(model_checkpoint)
text = "WELCOME TO AI WORLD." # Sentence to translate
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True)) # हा चाचणीचा प्रकरण आहे.
```
|