Downloads · 30 days
21
4% of all-time downloads
Jayveersinh-Raj/hindi-summarizer-small
hindi-summarizer-small is a machine learning model from Jayveersinh-Raj. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Hindi Summarization model. It summarizes a hindi paragraph.
Downloads · 30 days
21
4% of all-time downloads
All-time downloads
529
Public
Repo size
8.4 GB
Likes
2
Public
Click a slice to open those files.
.bin1.2 GB · 98%
From the Hugging Face model README
Hindi Summarization model. It summarizes a hindi paragraph.
from transformers import AutoTokenizer
from transformers import AutoModelForSeq2SeqLM, Seq2SeqTrainingArguments, Seq2SeqTrainer
checkpoint = "Jayveersinh-Raj/hindi-summarizer-small"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint)
# Input paragraph for summarization
input_sentence = "<sum> your hindi paragraph"
# Tokenize the input sentence
input_ids = tokenizer.encode(input_sentence, return_tensors="pt").to("cuda")
# Generate predictions
with torch.no_grad():
output_ids = model.generate(input_ids, max_new_tokens=200)
# Decode the generated output
output_sentence = tokenizer.decode(output_ids[0], skip_special_tokens=True)
# Print the generated output
print("Input:", input_sentence)
print("Summarized:", output_sentence)