@@ -105,13 +105,12 @@ def process_sampling_results(self):
105
105
except Exception as e :
106
106
model_server_logger .info ("while get input_data error: {0} {1}" .format (e , str (traceback .format_exc ())))
107
107
108
- def postprocess (self , batch_result , exist_finished_task = False ):
108
+ def postprocess (self , batch_result ):
109
109
"""
110
110
single post-processing function
111
111
112
112
Args:
113
113
batch_result (list): batch results
114
- exist_finished_task (bool): whether there is a finished task
115
114
"""
116
115
result_dir = "./generate_token_results"
117
116
if not os .path .exists (result_dir ):
@@ -218,7 +217,6 @@ def _process_batch_output(self):
218
217
accept_num = tokens [2 : batch + 2 ]
219
218
220
219
batch_result = list ()
221
- exist_finished_task = False
222
220
for i in range (batch ):
223
221
if self .resource_manager .stop_flags [i ]:
224
222
continue
@@ -253,11 +251,10 @@ def _process_batch_output(self):
253
251
f"Speculate accept ratio: { 1 - self .total_step * 1.0 / self .number_of_output_tokens } "
254
252
f" total step: { self .total_step } . total_output_token_num: { self .number_of_output_tokens } "
255
253
)
256
- exist_finished_task = True
257
254
break
258
255
batch_result .append (result )
259
256
260
- self .postprocess (batch_result , exist_finished_task )
257
+ self .postprocess (batch_result )
261
258
262
259
263
260
class WarmUpTokenProcessor (TokenProcessor ):
@@ -270,7 +267,7 @@ def __init__(self, cfg):
270
267
self ._is_running = True
271
268
self ._is_blocking = True
272
269
273
- def postprocess (self , batch_result , exist_finished_task = False ):
270
+ def postprocess (self , batch_result ):
274
271
pass
275
272
276
273
def process_sampling_results (self ):
0 commit comments