Instructions to use rajeshrai577/roman-to-nepali-mbart50 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rajeshrai577/roman-to-nepali-mbart50 with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="rajeshrai577/roman-to-nepali-mbart50")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("rajeshrai577/roman-to-nepali-mbart50") model = AutoModelForSeq2SeqLM.from_pretrained("rajeshrai577/roman-to-nepali-mbart50", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Roman to Nepali MBart50
This is a fine-tuned MBart50 model that translates Romanized Nepali text into Nepali (Devanagari script).
Model Details
Model Description
This model is fine-tuned on 500 Roman → Nepali sentence pairs using the facebook/mbart-large-50 base model.
It is intended for educational and fun NLP projects, allowing conversion of Romanized Nepali text into proper Nepali script.
- Developed by: rajeshrai
- Model type: MBart50
- Language(s): Romanized Nepali → Nepali (ne_NP)
- License: MIT (or your preferred license)
- Fine-tuned from: facebook/mbart-large-50
Model Sources
- Base Model Repository: facebook/mbart-large-50
Uses
Direct Use
- Translate Romanized Nepali text to Nepali (Devanagari) for educational purposes, chatbots, or small-scale projects.
Out-of-Scope Use
- This model is not suitable for professional translation or large-scale production as it is trained on only 500 sentence pairs.
- It may produce inaccurate translations for complex or long sentences.
Bias, Risks, and Limitations
- Trained on a small dataset, so coverage is limited.
- Might struggle with slang, rare words, or long sentences.
- Outputs should be reviewed by a human for critical use.
How to Get Started
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
model_name = "rajeshrai577/roman-to-nepali-mbart50"
model = MBartForConditionalGeneration.from_pretrained(model_name)
tokenizer = MBart50TokenizerFast.from_pretrained(model_name, src_lang="en_XX", tgt_lang="ne_NP")
input_text = "translate Roman Nepali to Nepali: ma ghar jaanchu."
inputs = tokenizer(input_text, return_tensors="pt")
generated_ids = model.generate(
**inputs,
forced_bos_token_id=tokenizer.lang_code_to_id["ne_NP"],
max_length=50
)
print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))
# Output: म घर जान्छु।
- Downloads last month
- 21