Skip to content

Commit 66e402f

Browse files
committed
make cloudpath save_best optional
Signed-off-by: Jack Luar <[email protected]>
1 parent bf46986 commit 66e402f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -581,11 +581,12 @@ def save_best(results):
581581
print(f"[INFO TUN-0003] Local: Best parameters written to {new_best_path}")
582582

583583
# Save to cloud storage
584-
new_best_path = f"{args.cloud_dir}/{args.experiment}/"
585-
new_best_path += f"autotuner-best-{trial_id}.json"
586-
with CloudPath(new_best_path).open("w") as new_best_file:
587-
json.dump(best_config, new_best_file, indent=4)
588-
print(f"[INFO TUN-0011] Cloud: Best parameters written to {new_best_path}")
584+
if args.cloud_dir:
585+
new_best_path = f"{args.cloud_dir}/{args.experiment}/"
586+
new_best_path += f"autotuner-best-{trial_id}.json"
587+
with CloudPath(new_best_path).open("w") as new_best_file:
588+
json.dump(best_config, new_best_file, indent=4)
589+
print(f"[INFO TUN-0011] Cloud: Best parameters written to {new_best_path}")
589590

590591

591592
def sweep():

0 commit comments

Comments
 (0)