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
367235ee
Unverified
Commit
367235ee
authored
Aug 31, 2020
by
Sam Shleifer
Committed by
GitHub
Aug 31, 2020
Browse files
Bart can make decoder_input_ids from labels (#6758)
parent
b9772897
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/transformers/modeling_bart.py
src/transformers/modeling_bart.py
+3
-1
No files found.
src/transformers/modeling_bart.py
View file @
367235ee
...
...
@@ -58,8 +58,8 @@ BART_PRETRAINED_MODEL_ARCHIVE_LIST = [
"facebook/bart-large-cnn"
,
"facebook/bart-large-xsum"
,
"facebook/mbart-large-en-ro"
,
# See all BART models at https://huggingface.co/models?filter=bart
]
# This list is incomplete. See all BART models at https://huggingface.co/models?filter=bart
BART_START_DOCSTRING
=
r
"""
...
...
@@ -1045,6 +1045,8 @@ class BartForConditionalGeneration(PretrainedBartModel):
if
labels
is
not
None
:
use_cache
=
False
if
decoder_input_ids
is
None
:
decoder_input_ids
=
shift_tokens_right
(
labels
,
self
.
config
.
pad_token_id
)
outputs
=
self
.
model
(
input_ids
,
...
...
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