From ba4e6e6df07e89d93af258ac30b804f48271f85d Mon Sep 17 00:00:00 2001 From: Jorg Doku Date: Tue, 5 Sep 2023 23:51:35 -0500 Subject: [PATCH] fix aggre --- src/handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/handler.py b/src/handler.py index 3d3ca7f..5ab4882 100644 --- a/src/handler.py +++ b/src/handler.py @@ -252,9 +252,10 @@ async def handler_streaming(job: dict) -> Generator[dict[str, list], None, None] # Include metrics in the highest level for the job output for aggregrate. def aggregate_function(streamed_outputs): - aggregate_output = "" + aggregate_output = [""] * len(streamed_outputs[0]['text']) for stream in streamed_outputs: - aggregate_output += stream['text'] + for id, seq in enumerate(stream['text']): + aggregate_output[id] += seq # Number of generated sequences num_seqs = sampling_params.n