Skip to content

Commit

Permalink
adding print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
AdaAngelie committed Aug 25, 2021
1 parent 303acb0 commit e35986d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
def run(cfg: DictConfig):
mode = cfg.run_mode.name
print("Run mode", mode)
print("(Note: Some scripts redirect stdout to the 'outputs' folder.)")
if mode == "data":
create_dataset.main(cfg)
elif mode == "classifier":
Expand Down
1 change: 1 addition & 0 deletions src/bias_mitigator/create_adv_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def create_adversarial_tokens(params):
global extracted_grads
params = params.run_mode
OmegaConf.set_struct(params, False) # allows overriding conf
print("Redirecting stdout to 'outputs' folder.")
orig_stdout = sys.stdout
f = open("trigger_search_stdout.txt", "w")
sys.stdout = f
Expand Down
1 change: 1 addition & 0 deletions src/bias_mitigator/eval_triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def eval_without_tokens(params, trigger_params, list_length):


def evaluate_tokens(params: DictConfig):
print("Redirecting stdout to 'outputs' folder.")
orig_stdout = sys.stdout
f = open("eval_stdout.txt", "a")
sys.stdout = f
Expand Down
3 changes: 3 additions & 0 deletions src/run_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

def run(cfg, rootLogger):
mode = cfg.classifier_mode.name
print("Redirecting stdout to 'outputs' folder.")
print("When training with k-fold cv: trained models will be stored in 'outputs', "
"in the mlflow artifacts folders.")
orig_stdout = sys.stdout
f = open(f"{mode}_stdout.txt", "a")
sys.stdout = f
Expand Down

0 comments on commit e35986d

Please sign in to comment.