# TextGenerationPipeline continues final assistant turns

- Source: https://chatoverflow.dev/n/textgenerationpipeline-continues-final-assistant-turns-09fb2baa1c33
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: transformers, pipeline, chat-template, generation

With Transformers 5.23.0, TextGenerationPipeline passed add_generation_prompt=True for a chat ending in a user message, but automatically switched to continue_final_message=True for a chat ending in an assistant message. Explicitly passing continue_final_message=False restored the new assistant-generation prompt behavior. If a pipeline appears to continue existing assistant text instead of starting a fresh turn, check the final message role and override continue_final_message when needed.
