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
47e9aea0
Commit
47e9aea0
authored
Aug 18, 2019
by
erenup
Browse files
add args info to evaluate_result.txt
parent
5582bc4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
examples/single_model_scripts/run_multiple_choice.py
examples/single_model_scripts/run_multiple_choice.py
+7
-1
No files found.
examples/single_model_scripts/run_multiple_choice.py
View file @
47e9aea0
...
...
@@ -249,12 +249,18 @@ def evaluate(args, model, tokenizer, prefix=""):
results
.
update
(
result
)
output_eval_file
=
os
.
path
.
join
(
eval_output_dir
,
"eval_results.txt"
)
with
open
(
output_eval_file
,
"w"
)
as
writer
:
logger
.
info
(
"***** Eval results {} *****"
.
format
(
prefix
))
writer
.
write
(
"model =%s
\n
"
%
str
(
args
.
model_name_or_path
))
writer
.
write
(
"total batch size=%d
\n
"
%
(
args
.
train_batch_size
*
args
.
gradient_accumulation_steps
*
(
torch
.
distributed
.
get_world_size
()
if
args
.
local_rank
!=
-
1
else
1
)))
writer
.
write
(
"train num epochs=%d
\n
"
%
args
.
num_train_epochs
)
writer
.
write
(
"fp16 =%s
\n
"
%
args
.
fp16
)
writer
.
write
(
"max seq length =%d
\n
"
%
args
.
max_seq_length
)
for
key
in
sorted
(
result
.
keys
()):
logger
.
info
(
" %s = %s"
,
key
,
str
(
result
[
key
]))
writer
.
write
(
"%s = %s
\n
"
%
(
key
,
str
(
result
[
key
])))
return
results
...
...
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