Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
6fe8a693
Unverified
Commit
6fe8a693
authored
Sep 30, 2020
by
Sam Shleifer
Committed by
GitHub
Sep 30, 2020
Browse files
[s2s] Fix t5 warning for distributed eval (#7487)
parent
4c672846
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
examples/seq2seq/run_distributed_eval.py
examples/seq2seq/run_distributed_eval.py
+8
-7
No files found.
examples/seq2seq/run_distributed_eval.py
View file @
6fe8a693
...
...
@@ -42,8 +42,7 @@ def eval_data_dir(
task
=
"summarization"
,
local_rank
=
None
,
num_return_sequences
=
1
,
src_lang
=
None
,
tgt_lang
=
None
,
dataset_kwargs
:
Dict
=
None
,
prefix
=
""
,
**
generate_kwargs
,
)
->
Dict
:
...
...
@@ -78,9 +77,8 @@ def eval_data_dir(
max_target_length
=
1024
,
type_path
=
type_path
,
n_obs
=
n_obs
,
src_lang
=
src_lang
,
tgt_lang
=
tgt_lang
,
prefix
=
prefix
,
**
dataset_kwargs
,
)
# I set shuffle=True for a more accurate progress bar.
# If all the longest samples are first, the prog bar estimate is too high at the beginning.
...
...
@@ -158,6 +156,11 @@ def run_generate():
if
intermediate_files
:
raise
ValueError
(
f
"Found files at
{
json_save_dir
}
please move or remove them."
)
# In theory, a node could finish and save before another node hits this. If this happens, we can address later.
dataset_kwargs
=
{}
if
args
.
src_lang
is
not
None
:
dataset_kwargs
[
"src_lang"
]
=
args
.
src_lang
if
args
.
tgt_lang
is
not
None
:
dataset_kwargs
[
"tgt_lang"
]
=
args
.
tgt_lang
Path
(
args
.
save_dir
).
mkdir
(
exist_ok
=
True
)
results
,
num_replicas
=
eval_data_dir
(
...
...
@@ -173,9 +176,7 @@ def run_generate():
max_source_length
=
args
.
max_source_length
,
num_return_sequences
=
args
.
num_return_sequences
,
prefix
=
args
.
prefix
,
src_lang
=
args
.
src_lang
,
tgt_lang
=
args
.
tgt_lang
,
**
generate_kwargs
,
dataset_kwargs
=
dataset_kwargs
**
generate_kwargs
,
)
if
args
.
local_rank
<=
0
:
...
...
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