How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" 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("summarization", model="prithivMLmods/t5-Flan-Prompt-Enhance")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/t5-Flan-Prompt-Enhance")
model = AutoModelForSeq2SeqLM.from_pretrained("prithivMLmods/t5-Flan-Prompt-Enhance")
Quick Links

xdfgzsxdfg.png

t5-Flan-Prompt-Enhance

T5-Flan-Prompt-Enhance is a fine-tuned model based on Flan-T5-Small, specifically designed to enhance prompts, captions, and annotations. This means the model has been further trained to improve the quality, clarity, and richness of textual inputs, making them more detailed and expressive.

Key Features:

  1. Prompt Expansion – Takes short or vague prompts and enriches them with more context, depth, and specificity.
  2. Caption Enhancement – Improves captions by adding more descriptive details, making them more informative and engaging.
  3. Annotation Refinement – Enhances annotations by making them clearer, more structured, and contextually relevant.

Run with Transformers

from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"

# Model checkpoint
model_checkpoint = "prithivMLmods/t5-Flan-Prompt-Enhance"

# Tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)

# Model
model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)

enhancer = pipeline('text2text-generation',
                    model=model,
                    tokenizer=tokenizer,
                    repetition_penalty=1.2,
                    device=0 if device == "cuda" else -1)

max_target_length = 256
prefix = "enhance prompt: "

short_prompt = "three chimneys on the roof, green trees and shrubs in front of the house"
answer = enhancer(prefix + short_prompt, max_length=max_target_length)
final_answer = answer[0]['generated_text']
print(final_answer)

This fine-tuning process allows T5-Flan-Prompt-Enhance to generate high-quality, well-structured, and contextually relevant outputs, which can be particularly useful for tasks such as text generation, content creation, and AI-assisted writing.

Downloads last month
29
Safetensors
Model size
77M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for prithivMLmods/t5-Flan-Prompt-Enhance

Quantized
(21)
this model

Spaces using prithivMLmods/t5-Flan-Prompt-Enhance 3