Skip to content

Commit

Permalink
Fix config saving
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgroot42 committed Feb 7, 2024
1 parent ed4bd72 commit 2cd6ae3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2cd6ae3

Please sign in to comment.