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
7ae4fc27
Unverified
Commit
7ae4fc27
authored
Jun 17, 2024
by
Yoach Lacombe
Committed by
GitHub
Jun 17, 2024
Browse files
Fix Bark logits processors device misplacement (#31416)
Fix Logits Processors device misplacement
parent
9af1b6a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/bark/modeling_bark.py
src/transformers/models/bark/modeling_bark.py
+2
-2
No files found.
src/transformers/models/bark/modeling_bark.py
View file @
7ae4fc27
...
...
@@ -991,11 +991,11 @@ class BarkSemanticModel(BarkCausalModel):
list
(
range
(
semantic_generation_config
.
semantic_pad_token
+
1
,
self
.
config
.
output_vocab_size
))
)
suppress_tokens_logits_processor
=
SuppressTokensLogitsProcessor
(
tokens_to_suppress
)
suppress_tokens_logits_processor
=
SuppressTokensLogitsProcessor
(
tokens_to_suppress
,
device
=
input_ids
.
device
)
min_eos_p
=
kwargs
.
get
(
"min_eos_p"
,
semantic_generation_config
.
min_eos_p
)
early_stopping_logits_processor
=
BarkEosPrioritizerLogitsProcessor
(
eos_token_id
=
semantic_generation_config
.
eos_token_id
,
min_eos_p
=
min_eos_p
eos_token_id
=
semantic_generation_config
.
eos_token_id
,
min_eos_p
=
min_eos_p
,
device
=
input_ids
.
device
)
# pass input_ids in order to stay consistent with the transformers generate method even though it is not used
...
...
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