Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
cd40f656
Unverified
Commit
cd40f656
authored
Jun 17, 2020
by
Sylvain Gugger
Committed by
GitHub
Jun 17, 2020
Browse files
Add header and fix command (#5082)
parent
70bc3ead
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
examples/adversarial/README.md
examples/adversarial/README.md
+1
-1
examples/adversarial/run_hans.py
examples/adversarial/run_hans.py
+1
-0
No files found.
examples/adversarial/README.md
View file @
cd40f656
...
...
@@ -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_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
\
--model_type
$MODEL_TYPE
\
--do_eval
\
...
...
examples/adversarial/run_hans.py
View file @
cd40f656
...
...
@@ -216,6 +216,7 @@ def main():
output_eval_file
=
os
.
path
.
join
(
training_args
.
output_dir
,
"hans_predictions.txt"
)
if
trainer
.
is_world_master
():
with
open
(
output_eval_file
,
"w"
)
as
writer
:
writer
.
write
(
"pairID,gold_label
\n
"
)
for
pid
,
pred
in
zip
(
pair_ids
,
preds
):
writer
.
write
(
"ex"
+
str
(
pid
)
+
","
+
label_list
[
int
(
pred
)]
+
"
\n
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment