Nepali Text Summarizer

Fine-tuned mBART-large-50 with LoRA adapters for abstractive summarization of Nepali text.

How to use

You can load the model and tokenizer directly from the Hugging Face Hub using the transformers library:

from transformers import MBartForConditionalGeneration, MBart50TokenizerFast

repo_id = "Suprishma/mbart-lora-nepali"
tokenizer = MBart50TokenizerFast.from_pretrained(repo_id)
model = MBartForConditionalGeneration.from_pretrained(repo_id)

# Example of how to perform summarization:
# nepali_text_to_summarize = "... your Nepali text ..."
# tokenizer.src_lang = "ne_NP"
# inputs = tokenizer(nepali_text_to_summarize, return_tensors="pt", max_length=1024, truncation=True)
# summary_ids = model.generate(
#     inputs["input_ids"],
#     num_beams=5,
#     max_length=150,
#     min_length=30,
#     early_stopping=True,
#     no_repeat_ngram_size=3,
#     forced_bos_token_id=tokenizer.lang_code_to_id["ne_NP"]
# )
# summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True, clean_up_tokenization_spaces=False)
# print(summary_text)
Downloads last month
11
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Suprishma/mbart-lora-nepali

Finetuned
(319)
this model