Downloads · 30 days
25
10% of all-time downloads
agentlans/flan-t5-small-title
flan-t5-small-title is a text generation model from agentlans. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
This model is a fine-tuned version of the Flan-T5 small model, specifically adapted for generating attention-grabbing titles based on given text. Flan-T5 is an improved version of the T5 (Text-To-Text Transfer Transfo…
Downloads · 30 days
25
10% of all-time downloads
All-time downloads
240
Public
Parameters
77M
309 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors308 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of the Flan-T5 small model, specifically adapted for generating attention-grabbing titles based on given text. Flan-T5 is an improved version of the T5 (Text-To-Text Transfer Transformer) model developed by Google, which has been instruction-tuned on a diverse set of tasks.
The model was fine-tuned on the "Wikipedia Paragraphs and AI-Generated Titles Dataset" (agentlans/wikipedia-paragraph-titles), which contains:
topic || textThe model was trained using the following framework versions:
To use the model, follow these steps:
topic||textHere's a code example demonstrating how to use the Flan-T5 small model for title generation:
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_name = "agentlans/flan-t5-small-title"
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Prepare the input text
topic = "The Serenity of Nature" # a cue to establish context (not necessary but recommended)
text = "As dawn breaks, the world awakens to a symphony of colors and sounds. The golden rays of sunlight filter through the leaves, casting playful shadows on the forest floor. Birds chirp melodiously, their songs weaving through the crisp morning air, while a gentle breeze rustles the branches overhead. Dew-kissed flowers bloom in vibrant hues, their fragrant scents mingling with the earthy aroma of damp soil. In this tranquil setting, one can’t help but feel a profound sense of peace and connection to the natural world, reminding us of the simple joys that life has to offer."
input_text = f"{topic}||{text}"
# Tokenize the input
inputs = tokenizer(input_text, return_tensors="pt", max_length=512, truncation=True)
# Generate the title
outputs = model.generate(**inputs, max_length=30, num_return_sequences=1)
# Decode and print the generated title
generated_title = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_title) # The Serenity of Nature: A Symbol of Peace and Harmony
This model is released under the Apache 2.0 license.