# Pipeline tutorial, summarization doesn't work

**URL:** <https://discuss.huggingface.co/t/pipeline-tutorial-summarization-doesnt-work/174833>\
**Category:** 🤗Transformers\
**Created:** [March 31, 2026, 9:35am UTC](https://discuss.huggingface.co/t/pipeline-tutorial-summarization-doesnt-work/174833 "2026-03-31T09:35:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [March 31, 2026, 9:47am UTC](https://discuss.huggingface.co/t/pipeline-tutorial-summarization-doesnt-work/174833/2 "2026-03-31T09:47:42Z")

</div>

Yeah. It’s real [version incompatibility between Transformers v4 and v5](https://discuss.huggingface.co/t/issue-with-summarization-and-translation-pipeline/173919).

If go with v5, try without pipeline:

```py
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

model_id = "google-t5/t5-small" # or your finetuned summarization checkpoint
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)

inputs = tokenizer(
    "summarize: " + text,
    return_tensors="pt",
    truncation=True
).input_ids

outputs = model.generate(inputs, max_new_tokens=100, do_sample=False)
summary = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(summary)

```

Or try another supported pipeline:

```py
from transformers import pipeline

summarizer = pipeline("text-generation", model="Qwen/Qwen3-4B-Instruct-2507")

messages = [
    {
        "role": "user",
        "content": "Summarize the following text in 3 bullet points:\n\n" + text
    }
]

out = summarizer(messages, max_new_tokens=200)
print(out[0]["generated_text"][-1]["content"])

```

---

_[View the full topic](https://discuss.huggingface.co/t/pipeline-tutorial-summarization-doesnt-work/174833)._
