Mizukiluke
commited on
Commit
•
1f567dd
1
Parent(s):
4071f0f
for ms-swift
Browse files- modeling_mplugowl3.py +2 -3
modeling_mplugowl3.py
CHANGED
@@ -88,9 +88,8 @@ class mPLUGOwl3Model(mPLUGOwl3PreTrainedModel):
|
|
88 |
if pixel_values is None:
|
89 |
return None
|
90 |
dtype = self.language_model.model.embed_tokens.weight.dtype
|
91 |
-
|
92 |
-
|
93 |
-
# image_embeds = self.vision_model(pixel_values.to(dtype), output_hidden_states=True).hidden_states[-2]
|
94 |
|
95 |
if self.vision2text_model is not None:
|
96 |
image_embeds = self.vision2text_model(image_embeds)
|
|
|
88 |
if pixel_values is None:
|
89 |
return None
|
90 |
dtype = self.language_model.model.embed_tokens.weight.dtype
|
91 |
+
image_embeds = self._small_batched_forward(pixel_values.to(dtype))
|
92 |
+
# image_embeds = self.vision_model(pixel_values.to(dtype), output_hidden_states=True).hidden_states[-2]
|
|
|
93 |
|
94 |
if self.vision2text_model is not None:
|
95 |
image_embeds = self.vision2text_model(image_embeds)
|