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
31c575bc
Unverified
Commit
31c575bc
authored
Mar 27, 2024
by
Marc Sun
Committed by
GitHub
Mar 27, 2024
Browse files
fix fuyu device_map compatibility (#29880)
fix foward
parent
4d8427f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/transformers/models/fuyu/modeling_fuyu.py
src/transformers/models/fuyu/modeling_fuyu.py
+3
-1
No files found.
src/transformers/models/fuyu/modeling_fuyu.py
View file @
31c575bc
...
...
@@ -290,7 +290,9 @@ class FuyuForCausalLM(FuyuPreTrainedModel):
inputs_embeds
=
self
.
language_model
.
get_input_embeddings
()(
input_ids
)
if
image_patches
is
not
None
and
past_key_values
is
None
:
patch_embeddings
=
[
self
.
vision_embed_tokens
(
patch
.
to
(
self
.
vision_embed_tokens
.
weight
.
dtype
)).
squeeze
(
0
)
self
.
vision_embed_tokens
(
patch
.
to
(
self
.
vision_embed_tokens
.
weight
.
dtype
))
.
squeeze
(
0
)
.
to
(
inputs_embeds
.
device
)
for
patch
in
image_patches
]
inputs_embeds
=
self
.
gather_continuous_embeddings
(
...
...
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