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
d30cf3d0
Unverified
Commit
d30cf3d0
authored
Jul 26, 2023
by
Yih-Dar
Committed by
GitHub
Jul 26, 2023
Browse files
Fix past CI after #24334 (#25113)
update Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
224da5df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/transformers/generation/logits_process.py
src/transformers/generation/logits_process.py
+3
-1
No files found.
src/transformers/generation/logits_process.py
View file @
d30cf3d0
...
@@ -725,7 +725,9 @@ class SequenceBiasLogitsProcessor(LogitsProcessor):
...
@@ -725,7 +725,9 @@ class SequenceBiasLogitsProcessor(LogitsProcessor):
torch
.
tensor
(
sequence_ids
[:
-
1
],
dtype
=
input_ids
.
dtype
,
device
=
input_ids
.
device
),
torch
.
tensor
(
sequence_ids
[:
-
1
],
dtype
=
input_ids
.
dtype
,
device
=
input_ids
.
device
),
).
prod
(
dim
=
1
)
).
prod
(
dim
=
1
)
bias
[:,
last_token
]
+=
torch
.
where
(
bias
[:,
last_token
]
+=
torch
.
where
(
matching_rows
.
bool
(),
sequence_bias
,
torch
.
tensor
(
0.0
,
device
=
input_ids
.
device
)
matching_rows
.
bool
(),
torch
.
tensor
(
sequence_bias
,
device
=
input_ids
.
device
),
torch
.
tensor
(
0.0
,
device
=
input_ids
.
device
),
)
)
# 5 - apply the bias to the scores
# 5 - apply the bias to the scores
...
...
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