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
ed6c8d37
Commit
ed6c8d37
authored
Jul 09, 2019
by
thomwolf
Browse files
fix merge
parent
e468192e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
examples/run_glue.py
examples/run_glue.py
+2
-2
pytorch_transformers/modeling_bert.py
pytorch_transformers/modeling_bert.py
+1
-1
No files found.
examples/run_glue.py
View file @
ed6c8d37
...
@@ -183,10 +183,10 @@ def evalutate(args, eval_task, eval_output_dir, dataset, model):
...
@@ -183,10 +183,10 @@ def evalutate(args, eval_task, eval_output_dir, dataset, model):
nb_eval_steps
+=
1
nb_eval_steps
+=
1
if
preds
is
None
:
if
preds
is
None
:
preds
=
logits
.
detach
().
cpu
().
numpy
()
preds
=
logits
.
detach
().
cpu
().
numpy
()
out_label_ids
=
label
_ids
.
detach
().
cpu
().
numpy
()
out_label_ids
=
inputs
[
'
label
s'
]
.
detach
().
cpu
().
numpy
()
else
:
else
:
preds
=
np
.
append
(
preds
,
logits
.
detach
().
cpu
().
numpy
(),
axis
=
0
)
preds
=
np
.
append
(
preds
,
logits
.
detach
().
cpu
().
numpy
(),
axis
=
0
)
out_label_ids
=
np
.
append
(
out_label_ids
,
label
_ids
.
detach
().
cpu
().
numpy
(),
axis
=
0
)
out_label_ids
=
np
.
append
(
out_label_ids
,
inputs
[
'
label
s'
]
.
detach
().
cpu
().
numpy
(),
axis
=
0
)
eval_loss
=
eval_loss
/
nb_eval_steps
eval_loss
=
eval_loss
/
nb_eval_steps
if
args
.
output_mode
==
"classification"
:
if
args
.
output_mode
==
"classification"
:
...
...
pytorch_transformers/modeling_bert.py
View file @
ed6c8d37
...
@@ -176,7 +176,7 @@ class BertConfig(PretrainedConfig):
...
@@ -176,7 +176,7 @@ class BertConfig(PretrainedConfig):
initializing all weight matrices.
initializing all weight matrices.
layer_norm_eps: The epsilon used by LayerNorm.
layer_norm_eps: The epsilon used by LayerNorm.
"""
"""
pretrained_config_archive_map
=
PRETRAINED_CONFIG_ARCHIVE_MAP
pretrained_config_archive_map
=
BERT_
PRETRAINED_CONFIG_ARCHIVE_MAP
def
__init__
(
self
,
def
__init__
(
self
,
vocab_size_or_config_json_file
=
30522
,
vocab_size_or_config_json_file
=
30522
,
...
...
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