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
d6eaf4e6
Commit
d6eaf4e6
authored
Dec 22, 2019
by
Aymeric Augustin
Browse files
Update comments mentioning Python 2.
parent
45841eaf
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
11 additions
and
11 deletions
+11
-11
examples/contrib/run_swag.py
examples/contrib/run_swag.py
+1
-1
examples/distillation/run_squad_w_distillation.py
examples/distillation/run_squad_w_distillation.py
+1
-1
examples/mm-imdb/run_mmimdb.py
examples/mm-imdb/run_mmimdb.py
+1
-1
examples/run_glue.py
examples/run_glue.py
+1
-1
examples/run_lm_finetuning.py
examples/run_lm_finetuning.py
+1
-1
examples/run_multiple_choice.py
examples/run_multiple_choice.py
+1
-1
examples/run_ner.py
examples/run_ner.py
+1
-1
examples/run_squad.py
examples/run_squad.py
+1
-1
examples/run_xnli.py
examples/run_xnli.py
+1
-1
setup.py
setup.py
+1
-1
templates/adding_a_new_example_script/run_xxx.py
templates/adding_a_new_example_script/run_xxx.py
+1
-1
No files found.
examples/contrib/run_swag.py
View file @
d6eaf4e6
...
...
@@ -341,7 +341,7 @@ def train(args, train_dataset, model, tokenizer):
tr_loss
,
logging_loss
=
0.0
,
0.0
model
.
zero_grad
()
train_iterator
=
trange
(
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
set_seed
(
args
)
# Added here for reproductibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproductibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
examples/distillation/run_squad_w_distillation.py
View file @
d6eaf4e6
...
...
@@ -159,7 +159,7 @@ def train(args, train_dataset, model, tokenizer, teacher=None):
tr_loss
,
logging_loss
=
0.0
,
0.0
model
.
zero_grad
()
train_iterator
=
trange
(
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
set_seed
(
args
)
# Added here for reproductibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproductibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
examples/mm-imdb/run_mmimdb.py
View file @
d6eaf4e6
...
...
@@ -164,7 +164,7 @@ def train(args, train_dataset, model, tokenizer, criterion):
best_f1
,
n_no_improve
=
0
,
0
model
.
zero_grad
()
train_iterator
=
trange
(
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
set_seed
(
args
)
# Added here for reproductibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproductibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
examples/run_glue.py
View file @
d6eaf4e6
...
...
@@ -185,7 +185,7 @@ def train(args, train_dataset, model, tokenizer):
train_iterator
=
trange
(
epochs_trained
,
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
]
)
set_seed
(
args
)
# Added here for reproductibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproductibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
examples/run_lm_finetuning.py
View file @
d6eaf4e6
...
...
@@ -281,7 +281,7 @@ def train(args, train_dataset, model, tokenizer):
train_iterator
=
trange
(
epochs_trained
,
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
]
)
set_seed
(
args
)
# Added here for reproducibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproducibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
examples/run_multiple_choice.py
View file @
d6eaf4e6
...
...
@@ -145,7 +145,7 @@ def train(args, train_dataset, model, tokenizer):
best_steps
=
0
model
.
zero_grad
()
train_iterator
=
trange
(
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
set_seed
(
args
)
# Added here for reproductibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproductibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
examples/run_ner.py
View file @
d6eaf4e6
...
...
@@ -169,7 +169,7 @@ def train(args, train_dataset, model, tokenizer, labels, pad_token_label_id):
train_iterator
=
trange
(
epochs_trained
,
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
]
)
set_seed
(
args
)
# Added here for reproductibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproductibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
examples/run_squad.py
View file @
d6eaf4e6
...
...
@@ -185,7 +185,7 @@ def train(args, train_dataset, model, tokenizer):
train_iterator
=
trange
(
epochs_trained
,
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
]
)
# Added here for reproductibility
(even between python 2 and 3)
# Added here for reproductibility
set_seed
(
args
)
for
_
in
train_iterator
:
...
...
examples/run_xnli.py
View file @
d6eaf4e6
...
...
@@ -164,7 +164,7 @@ def train(args, train_dataset, model, tokenizer):
train_iterator
=
trange
(
epochs_trained
,
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
]
)
set_seed
(
args
)
# Added here for reproductibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproductibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
setup.py
View file @
d6eaf4e6
...
...
@@ -14,7 +14,7 @@ To create the package for pypi.
creating the wheel and the source distribution (obviously).
For the wheel, run: "python setup.py bdist_wheel" in the top level directory.
(this will build a wheel for the python version you use to build it
- make sure you use python 3.x
).
(this will build a wheel for the python version you use to build it).
For the sources, run: "python setup.py sdist"
You should now have a /dist directory with both .whl and .tar.gz source versions.
...
...
templates/adding_a_new_example_script/run_xxx.py
View file @
d6eaf4e6
...
...
@@ -155,7 +155,7 @@ def train(args, train_dataset, model, tokenizer):
tr_loss
,
logging_loss
=
0.0
,
0.0
model
.
zero_grad
()
train_iterator
=
trange
(
int
(
args
.
num_train_epochs
),
desc
=
"Epoch"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
set_seed
(
args
)
# Added here for reproductibility
(even between python 2 and 3)
set_seed
(
args
)
# Added here for reproductibility
for
_
in
train_iterator
:
epoch_iterator
=
tqdm
(
train_dataloader
,
desc
=
"Iteration"
,
disable
=
args
.
local_rank
not
in
[
-
1
,
0
])
for
step
,
batch
in
enumerate
(
epoch_iterator
):
...
...
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