fix benchmark

This commit is contained in:
Tara Ding 2026-04-27 22:44:00 -07:00
parent a2204ec976
commit 9ea25780c6

12
main.py
View File

@ -315,6 +315,12 @@ def prompt_worker(q, server_instance):
need_gc = True
if benchmark_mode:
e.history_result["benchmark"] = {
"execution_ms": (time.perf_counter() - execution_start_time) * 1000.0,
"nodes": e.node_timing_ms,
}
remove_sensitive = lambda prompt: prompt[:5] + prompt[6:]
q.task_done(item_id,
e.history_result,
@ -335,12 +341,6 @@ def prompt_worker(q, server_instance):
else:
logging.info("Prompt executed in {:.2f} seconds".format(execution_time))
if benchmark_mode:
e.history_result["benchmark"] = {
"execution_ms": execution_time * 1000.0,
"nodes": e.node_timing_ms,
}
if not asset_seeder.is_disabled():
paths = _collect_output_absolute_paths(e.history_result)
register_output_files(paths, job_id=prompt_id)