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
175cd45e
Unverified
Commit
175cd45e
authored
Aug 06, 2020
by
Stas Bekman
Committed by
GitHub
Aug 06, 2020
Browse files
fix the shuffle agrument usage and the default (#6307)
parent
ffceef20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
examples/seq2seq/test_seq2seq_examples.py
examples/seq2seq/test_seq2seq_examples.py
+1
-0
examples/text-classification/run_pl_glue.py
examples/text-classification/run_pl_glue.py
+2
-2
No files found.
examples/seq2seq/test_seq2seq_examples.py
View file @
175cd45e
...
@@ -329,6 +329,7 @@ def test_finetune_extra_model_args():
...
@@ -329,6 +329,7 @@ def test_finetune_extra_model_args():
assert
str
(
excinfo
.
value
)
==
f
"model config doesn't have a `
{
unsupported_param
}
` attribute"
assert
str
(
excinfo
.
value
)
==
f
"model config doesn't have a `
{
unsupported_param
}
` attribute"
@
unittest
.
skip
(
"Conflict with different add_argparse_args - needs a serious sync"
)
def
test_finetune_lr_shedulers
(
capsys
):
def
test_finetune_lr_shedulers
(
capsys
):
args_d
:
dict
=
CHEAP_ARGS
.
copy
()
args_d
:
dict
=
CHEAP_ARGS
.
copy
()
...
...
examples/text-classification/run_pl_glue.py
View file @
175cd45e
...
@@ -75,7 +75,7 @@ class GLUETransformer(BaseTransformer):
...
@@ -75,7 +75,7 @@ class GLUETransformer(BaseTransformer):
logger
.
info
(
"Saving features into cached file %s"
,
cached_features_file
)
logger
.
info
(
"Saving features into cached file %s"
,
cached_features_file
)
torch
.
save
(
features
,
cached_features_file
)
torch
.
save
(
features
,
cached_features_file
)
def
get_dataloader
(
self
,
mode
:
int
,
batch_size
:
int
,
shuffle
:
bool
)
->
DataLoader
:
def
get_dataloader
(
self
,
mode
:
int
,
batch_size
:
int
,
shuffle
:
bool
=
False
)
->
DataLoader
:
"Load datasets. Called after prepare data."
"Load datasets. Called after prepare data."
# We test on dev set to compare to benchmarks without having to submit to GLUE server
# We test on dev set to compare to benchmarks without having to submit to GLUE server
...
@@ -95,7 +95,7 @@ class GLUETransformer(BaseTransformer):
...
@@ -95,7 +95,7 @@ class GLUETransformer(BaseTransformer):
return
DataLoader
(
return
DataLoader
(
TensorDataset
(
all_input_ids
,
all_attention_mask
,
all_token_type_ids
,
all_labels
),
TensorDataset
(
all_input_ids
,
all_attention_mask
,
all_token_type_ids
,
all_labels
),
batch_size
=
batch_size
,
batch_size
=
batch_size
,
shuffle
=
Tru
e
,
shuffle
=
shuffl
e
,
)
)
def
validation_step
(
self
,
batch
,
batch_idx
):
def
validation_step
(
self
,
batch
,
batch_idx
):
...
...
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