From 2cd6ae3aaea68c38b794306b34d53d5354cb06bc Mon Sep 17 00:00:00 2001 From: Anshuman Suri Date: Wed, 7 Feb 2024 09:11:30 -0500 Subject: [PATCH] Fix config saving --- run.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/run.py b/run.py index 11c3045..495f1bb 100644 --- a/run.py +++ b/run.py @@ -457,10 +457,6 @@ def main(config: ExperimentConfig): os.makedirs(SAVE_FOLDER) print(f"Saving results to absolute path: {os.path.abspath(SAVE_FOLDER)}") - # write args to file - # if not config.dump_cache: - # config.save(os.path.join(SAVE_FOLDER, 'args.json'), indent=4) - if neigh_config: n_perturbation_list = neigh_config.n_perturbation_list in_place_swap = neigh_config.original_tokenization_swap @@ -684,8 +680,7 @@ def main(config: ExperimentConfig): exit(0) # Dump main config into SAVE_FOLDER - with open(os.path.join(SAVE_FOLDER, "config.json"), "w") as f: - config.save(f) + config.save(os.path.join(SAVE_FOLDER, 'config.json'), indent=4) for attack, output in blackbox_outputs.items(): outputs.append(output)