Downloads · 30 days
10.2K
1% of all-time downloads
IlyaGusev/rut5_base_headline_gen_telegram
rut5_base_headline_gen_telegram is a summarization model from IlyaGusev. Use it when you need a shorter version of a longer text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
10.2K
1% of all-time downloads
All-time downloads
840K
Public
Repo size
2 GB
Likes
9
Public
Click a slice to open those files.
.bin977 MB · 100%
From the Hugging Face model README
Based on rut5-base model
from transformers import AutoTokenizer, T5ForConditionalGeneration
model_name = "IlyaGusev/rut5_base_headline_gen_telegram"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
article_text = "..."
input_ids = tokenizer(
[article_text],
max_length=600,
add_special_tokens=True,
padding="max_length",
truncation=True,
return_tensors="pt"
)["input_ids"]
output_ids = model.generate(
input_ids=input_ids
)[0]
headline = tokenizer.decode(output_ids, skip_special_tokens=True)
print(headline)