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
94eb68d7
"docs/vscode:/vscode.git/clone" did not exist on "78b87dc25aa3cb5eab282354d9b001b90a75cca4"
Commit
94eb68d7
authored
Apr 04, 2020
by
Julien Chaumond
Browse files
weigths*weights
parent
243e687b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
docs/source/migration.md
docs/source/migration.md
+1
-1
src/transformers/modeling_transfo_xl.py
src/transformers/modeling_transfo_xl.py
+1
-1
src/transformers/modeling_xlnet.py
src/transformers/modeling_xlnet.py
+1
-1
templates/adding_a_new_model/README.md
templates/adding_a_new_model/README.md
+1
-1
No files found.
docs/source/migration.md
View file @
94eb68d7
...
...
@@ -27,7 +27,7 @@ loss = outputs[0]
# In transformers you can also have access to the logits:
loss
,
logits
=
outputs
[:
2
]
# And even the attention weig
t
hs if you configure the model to output them (and other outputs too, see the docstrings and documentation)
# And even the attention weigh
t
s if you configure the model to output them (and other outputs too, see the docstrings and documentation)
model
=
BertForSequenceClassification
.
from_pretrained
(
'bert-base-uncased'
,
output_attentions
=
True
)
outputs
=
model
(
input_ids
,
labels
=
labels
)
loss
,
logits
,
attentions
=
outputs
...
...
src/transformers/modeling_transfo_xl.py
View file @
94eb68d7
...
...
@@ -136,7 +136,7 @@ def load_tf_weights_in_transfo_xl(model, config, tf_path):
if
"kernel"
in
name
or
"proj"
in
name
:
array
=
np
.
transpose
(
array
)
if
(
"r_r_bias"
in
name
or
"r_w_bias"
in
name
)
and
len
(
pointer
)
>
1
:
# Here we will split the TF weig
t
hs
# Here we will split the TF weigh
t
s
assert
len
(
pointer
)
==
array
.
shape
[
0
]
for
i
,
p_i
in
enumerate
(
pointer
):
arr_i
=
array
[
i
,
...]
...
...
src/transformers/modeling_xlnet.py
View file @
94eb68d7
...
...
@@ -156,7 +156,7 @@ def load_tf_weights_in_xlnet(model, config, tf_path):
logger
.
info
(
"Transposing"
)
array
=
np
.
transpose
(
array
)
if
isinstance
(
pointer
,
list
):
# Here we will split the TF weig
t
hs
# Here we will split the TF weigh
t
s
assert
len
(
pointer
)
==
array
.
shape
[
0
]
for
i
,
p_i
in
enumerate
(
pointer
):
arr_i
=
array
[
i
,
...]
...
...
templates/adding_a_new_model/README.md
View file @
94eb68d7
...
...
@@ -59,4 +59,4 @@ You can then finish the addition step by adding imports for your classes in the
-
[ ] add a link to your conversion script in the main conversion utility (in
`commands/convert.py`
)
-
[ ] edit the PyTorch to TF 2.0 conversion script to add your model in the
`convert_pytorch_checkpoint_to_tf2.py`
file
-
[ ] add a mention of your model in the doc:
`README.md`
and the documentation itself at
`docs/source/pretrained_models.rst`
.
-
[ ] upload the pretrained weig
t
hs, configurations and vocabulary files.
-
[ ] upload the pretrained weigh
t
s, configurations and vocabulary files.
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