"tests/vscode:/vscode.git/clone" did not exist on "dd4459ad795230ee6d70dc270484bb9b523db9d4"
Unverified Commit cd40f656 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Add header and fix command (#5082)

parent 70bc3ead
...@@ -11,7 +11,7 @@ export HANS_DIR=path-to-hans ...@@ -11,7 +11,7 @@ export HANS_DIR=path-to-hans
export MODEL_TYPE=type-of-the-model-e.g.-bert-roberta-xlnet-etc export MODEL_TYPE=type-of-the-model-e.g.-bert-roberta-xlnet-etc
export MODEL_PATH=path-to-the-model-directory-that-is-trained-on-NLI-e.g.-by-using-run_glue.py export MODEL_PATH=path-to-the-model-directory-that-is-trained-on-NLI-e.g.-by-using-run_glue.py
python examples/adversarial/test_hans.py \ python run_hans.py \
--task_name hans \ --task_name hans \
--model_type $MODEL_TYPE \ --model_type $MODEL_TYPE \
--do_eval \ --do_eval \
......
...@@ -216,6 +216,7 @@ def main(): ...@@ -216,6 +216,7 @@ def main():
output_eval_file = os.path.join(training_args.output_dir, "hans_predictions.txt") output_eval_file = os.path.join(training_args.output_dir, "hans_predictions.txt")
if trainer.is_world_master(): if trainer.is_world_master():
with open(output_eval_file, "w") as writer: with open(output_eval_file, "w") as writer:
writer.write("pairID,gold_label\n")
for pid, pred in zip(pair_ids, preds): for pid, pred in zip(pair_ids, preds):
writer.write("ex" + str(pid) + "," + label_list[int(pred)] + "\n") writer.write("ex" + str(pid) + "," + label_list[int(pred)] + "\n")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment