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
3773ba44
Unverified
Commit
3773ba44
authored
Aug 07, 2019
by
Thomas Wolf
Committed by
GitHub
Aug 07, 2019
Browse files
Merge pull request #977 from chrisgzf/master
Fixed typo in migration guide
parents
a80aa03b
a6f412da
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 @
3773ba44
...
...
@@ -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