{"record":{"id":"01fc38c732401603","repo":"huggingface/transformers","slug":"streaming-is-not-supported-for-continuous-batching","errorCode":null,"errorMessage":"streaming is not supported for continuous batching. Got {streamer = }","messagePattern":"streaming is not supported for continuous batching\\. Got (.+?)","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/transformers/generation/utils.py","lineNumber":2424,"sourceCode":"                inputs = inputs.tolist()\n            else:\n                raise ValueError(f\"inputs must be a 1D or 2D tensor, got {inputs.dim() = }\")\n\n            # some arguments are not supported for continuous batching\n            if stopping_criteria is not None:\n                raise NotImplementedError(\n                    f\"stopping_criteria is not supported for continuous batching. Got {stopping_criteria = }\"\n                )\n            if prefix_allowed_tokens_fn is not None:\n                raise NotImplementedError(\n                    f\"prefix_allowed_tokens_fn is not supported for continuous batching. Got {prefix_allowed_tokens_fn = }\"\n                )\n            if assistant_model is not None:\n                raise NotImplementedError(\n                    f\"assistant_model is not supported for continuous batching. Got {assistant_model = }\"\n                )\n            if streamer is not None:  # TODO: actually this could be supported\n                raise NotImplementedError(f\"streaming is not supported for continuous batching. Got {streamer = }\")\n            if negative_prompt_ids is not None:\n                raise NotImplementedError(\n                    f\"negative_prompt_ids is not supported for continuous batching. Got {negative_prompt_ids = }\"\n                )\n            if negative_prompt_attention_mask is not None:\n                raise NotImplementedError(\n                    f\"negative_prompt_attention_mask is not supported for continuous batching. Got {negative_prompt_attention_mask = }\"\n                )\n\n            # others are ignored\n            if synced_gpus is not None:\n                logger.warning(f\"synced_gpus is ignored for continuous batching. Got {synced_gpus = }\")\n            num_beams = kwargs.get(\"num_beams\", 1)\n            if num_beams > 1:  # FIXME: remove this once CB supports num_beams (which is planned)\n                logger.warning(f\"num_beams is not supported for continuous batching yet. Got {num_beams = }. \")\n\n            # switch to CB\n            outputs = self.generate_batch(","sourceCodeStart":2406,"sourceCodeEnd":2442,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/generation/utils.py#L2406-L2442","documentation":"Error \"streaming is not supported for continuous batching. Got {streamer = }\" thrown in huggingface/transformers.","triggerScenarios":"Raised in generate() when a streamer is passed while using continuous batching mode.","commonSituations":"Passing streamer=TextStreamer(...) to a generate() call routed to continuous batching.","solutions":["Do not pass a `streamer` with continuous batching; consume streamed output via the continuous batching output API instead.","Use standard `generate()` if you need a TextStreamer."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}