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
a6f412da
Commit
a6f412da
authored
Aug 07, 2019
by
Christopher Goh
Browse files
Fixed typo in migration guide
parent
4fc9f9ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
README.md
README.md
+1
-1
No files found.
README.md
View file @
a6f412da
...
...
@@ -314,7 +314,7 @@ loss = outputs[0]
# In pytorch-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
...
...
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