MCPcopy Create free account
hub / github.com/HKUDS/AutoAgent / update_progress

Function update_progress

evaluation/utils.py:325–339  ·  view source on GitHub ↗

Update the progress bar and write the result to the output file.

(
    result: EvalOutput,
    pbar: tqdm,
    output_fp: TextIO,
)

Source from the content-addressed store, hash-verified

323 time.sleep(5)
324
325def update_progress(
326 result: EvalOutput,
327 pbar: tqdm,
328 output_fp: TextIO,
329):
330 """Update the progress bar and write the result to the output file."""
331 logger = LoggerManager.get_logger()
332 pbar.update(1)
333 pbar.set_description(f'Instance {result.instance_id}')
334 pbar.set_postfix_str(f'Test Result: {str(result.test_result)[:300]}...')
335 logger.info(
336 f'Finished evaluation for instance {result.instance_id}: {str(result.test_result)[:300]}...\n'
337 )
338 output_fp.write(json.dumps(result.model_dump()) + '\n')
339 output_fp.flush()
340
341def cleanup():
342 print('Cleaning up child processes...')

Callers 1

run_evaluationFunction · 0.85

Calls 3

get_loggerMethod · 0.80
infoMethod · 0.80
model_dumpMethod · 0.45

Tested by

no test coverage detected