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
cdf1b7ae
Unverified
Commit
cdf1b7ae
authored
Nov 18, 2020
by
Stas Bekman
Committed by
GitHub
Nov 18, 2020
Browse files
fix to adjust for #8530 changes (#8612)
parent
2819da02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/seq2seq/finetune.py
examples/seq2seq/finetune.py
+1
-1
No files found.
examples/seq2seq/finetune.py
View file @
cdf1b7ae
...
@@ -148,7 +148,7 @@ class SummarizationModule(BaseTransformer):
...
@@ -148,7 +148,7 @@ class SummarizationModule(BaseTransformer):
self
.
save_readable_batch
(
batch
)
self
.
save_readable_batch
(
batch
)
outputs
=
self
(
src_ids
,
attention_mask
=
src_mask
,
decoder_input_ids
=
decoder_input_ids
,
use_cache
=
False
)
outputs
=
self
(
src_ids
,
attention_mask
=
src_mask
,
decoder_input_ids
=
decoder_input_ids
,
use_cache
=
False
)
lm_logits
=
outputs
[
0
]
lm_logits
=
outputs
[
"logits"
]
if
self
.
hparams
.
label_smoothing
==
0
:
if
self
.
hparams
.
label_smoothing
==
0
:
# Same behavior as modeling_bart.py, besides ignoring pad_token_id
# Same behavior as modeling_bart.py, besides ignoring pad_token_id
ce_loss_fct
=
torch
.
nn
.
CrossEntropyLoss
(
ignore_index
=
pad_token_id
)
ce_loss_fct
=
torch
.
nn
.
CrossEntropyLoss
(
ignore_index
=
pad_token_id
)
...
...
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