diff --git a/extensions/HuggingFaceTransformers/python/src/aiconfig_extension_hugging_face_transformers/text_generation.py b/extensions/HuggingFaceTransformers/python/src/aiconfig_extension_hugging_face_transformers/text_generation.py index 7646e59c9..9751eb27d 100644 --- a/extensions/HuggingFaceTransformers/python/src/aiconfig_extension_hugging_face_transformers/text_generation.py +++ b/extensions/HuggingFaceTransformers/python/src/aiconfig_extension_hugging_face_transformers/text_generation.py @@ -251,6 +251,7 @@ async def run_inference( response : List[Any] = generator(**completion_data) for count, result in enumerate(response): output = construct_regular_output(result, count) + outputs.append(output) else: if completion_data.get("num_return_sequences", 1) > 1: raise ValueError("Sorry, TextIteratorStreamer does not support multiple return sequences, please set `num_return_sequences` to 1") @@ -261,8 +262,8 @@ async def run_inference( thread = threading.Thread(target=generator, kwargs=completion_data) thread.start() output = construct_stream_output(streamer, options) - if output is not None: - outputs.append(output) + if output is not None: + outputs.append(output) prompt.outputs = outputs return prompt.outputs