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
d3a8df6b
"benchmark/git@developer.sourcefind.cn:change/sglang.git" did not exist on "b0d25e72c401f37b55d689ddbf05b8c583afe854"
Commit
d3a8df6b
authored
Nov 01, 2018
by
VictorSanh
Browse files
typos in `input_fn_builder`
parent
836faed9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
run_classifier_pytorch.py
run_classifier_pytorch.py
+2
-2
No files found.
run_classifier_pytorch.py
View file @
d3a8df6b
...
...
@@ -434,7 +434,7 @@ def model_fn_builder(bert_config, num_labels, init_checkpoint, learning_rate,
### ATTENTION - I removed the `use_tpu` argument
def
input_fn_builder
(
features
,
seq_length
,
is_training
,
eval_
drop_remainder
):
def
input_fn_builder
(
features
,
seq_length
,
is_training
,
drop_remainder
):
"""Creates an `input_fn` closure to be passed to TPUEstimator."""
### ATTENTION - To rewrite ###
all_input_ids
=
[]
...
...
@@ -462,7 +462,7 @@ def input_fn_builder(features, seq_length, is_training, eval_drop_remainder):
"label_ids"
:
torch
.
IntTensor
(
all_label_ids
,
device
=
device
)
})
shuffle
=
True
if
training
else
False
shuffle
=
True
if
is_
training
else
False
d
=
torch
.
utils
.
data
.
DataLoader
(
dataset
=
d
,
batch_size
=
batch_size
,
shuffle
=
shuffle
,
drop_last
=
drop_remainder
)
# Cf https://pytorch.org/tutorials/beginner/data_loading_tutorial.html
...
...
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