@@ -100,13 +100,12 @@ def process_sampling_results(self):
100
100
except Exception as e :
101
101
model_server_logger .info ("while get input_data error: {0} {1}" .format (e , str (traceback .format_exc ())))
102
102
103
- def postprocess (self , batch_result , exist_finished_task = False ):
103
+ def postprocess (self , batch_result ):
104
104
"""
105
105
single post-processing function
106
106
107
107
Args:
108
108
batch_result (list): batch results
109
- exist_finished_task (bool): whether there is a finished task
110
109
"""
111
110
result_dir = "./generate_token_results"
112
111
if not os .path .exists (result_dir ):
@@ -213,7 +212,6 @@ def _process_batch_output(self):
213
212
accept_num = tokens [2 : batch + 2 ]
214
213
215
214
batch_result = list ()
216
- exist_finished_task = False
217
215
for i in range (batch ):
218
216
if self .resource_manager .stop_flags [i ]:
219
217
continue
@@ -248,11 +246,10 @@ def _process_batch_output(self):
248
246
f"Speculate accept ratio: { 1 - self .total_step * 1.0 / self .number_of_output_tokens } "
249
247
f" total step: { self .total_step } . total_output_token_num: { self .number_of_output_tokens } "
250
248
)
251
- exist_finished_task = True
252
249
break
253
250
batch_result .append (result )
254
251
255
- self .postprocess (batch_result , exist_finished_task )
252
+ self .postprocess (batch_result )
256
253
257
254
258
255
class WarmUpTokenProcessor (TokenProcessor ):
@@ -265,7 +262,7 @@ def __init__(self, cfg):
265
262
self ._is_running = True
266
263
self ._is_blocking = True
267
264
268
- def postprocess (self , batch_result , exist_finished_task = False ):
265
+ def postprocess (self , batch_result ):
269
266
pass
270
267
271
268
def process_sampling_results (self ):
0 commit comments