Skip to content

Commit

Permalink
Avoid creation of empty model_mapping.json
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Nov 12, 2024
1 parent fbc74fa commit 4dcd13a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions script/generate-mlperf-inference-submission/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ def generate_submission(i):
system_file = os.path.join(submission_system_path, sub_res+".json")

# Save the model mapping json file
with open(os.path.join(path_submission,"model_mapping.json"), "w") as fp:
json.dump(model_mapping_combined, fp, indent=2)
if model_mapping_combined:
with open(os.path.join(path_submission,"model_mapping.json"), "w") as fp:
json.dump(model_mapping_combined, fp, indent=2)

models = [f for f in os.listdir(result_path) if not os.path.isfile(os.path.join(result_path, f))]

Expand Down

0 comments on commit 4dcd13a

Please sign in to comment.