Skip to content

Commit

Permalink
✨ feat(utils): add timestamp to submission file names
Browse files Browse the repository at this point in the history
- import time module for timestamp generation
- append timestamp to submission file names for uniqueness and traceability
  • Loading branch information
Luodian committed Jan 14, 2025
1 parent 935fc32 commit 7ba48f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lmms_eval/tasks/megabench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def megabench_process_results(doc, result):
return {"submission": data_dict}


import time


def megabench_aggregate_results_for_submission(results, args):
results_by_task = defaultdict(list)
for result in results:
Expand All @@ -115,7 +118,8 @@ def megabench_aggregate_results_for_submission(results, args):
task_result["query_response"] = all_query_response
submission_results.append(task_result)

submission_path = generate_submission_file(f"{args.tasks}_all_query_responses.json", args)
timestamp = time.strftime("%m-%d-%H-%M")
submission_path = generate_submission_file(f"megabench_all_query_responses_{timestamp}.json", args)
with open(submission_path, "w", encoding="utf-8") as fd:
json.dump(submission_results, fd, indent=4)
eval_logger.info(f"Results saved to {submission_path}.")

0 comments on commit 7ba48f9

Please sign in to comment.