Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

This model bases on T5-base model, finetuned using bbc-news-summary dataset Example of using:

from transformers import pipeline, T5ForConditionalGeneration, T5Tokenizer
import torch
model_name = "Andrew0488/t5-summarizer"
model = T5ForConditionalGeneration.from_pretrained(model_name).cuda()
tokenizer = T5Tokenizer.from_pretrained(model_name)

def t5_summary(text: str):
    inputs = tokenizer.encode(
        "summarize: " + text,
        return_tensors='pt',
        max_length=2000,
        truncation=True,
        padding='max_length'
    ).to(torch.device("cuda"))

    # Generate the summary
    summary_ids = model.generate(
        inputs,
        max_length=250,
        num_beams=5
    )
    return tokenizer.decode(summary_ids[0], skip_special_tokens=True)
Downloads last month
192
Safetensors
Model size
223M params
Tensor type
F32
·
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.