update text-only input bugs
Browse files- modeling_imp.py +2 -0
modeling_imp.py
CHANGED
@@ -1237,6 +1237,8 @@ class LlavaMetaForCausalLM(ABC):
|
|
1237 |
):
|
1238 |
vision_tower = self.get_vision_tower()
|
1239 |
# if vision_tower is None or images is None or past_key_values.seqlen_offset != 0:
|
|
|
|
|
1240 |
if past_key_values is not None:
|
1241 |
target_shape = past_key_values[0][0].shape[2] + 1
|
1242 |
attention_mask = torch.ones(
|
|
|
1237 |
):
|
1238 |
vision_tower = self.get_vision_tower()
|
1239 |
# if vision_tower is None or images is None or past_key_values.seqlen_offset != 0:
|
1240 |
+
if images is None:
|
1241 |
+
return input_ids, position_ids, attention_mask, past_key_values, None, labels
|
1242 |
if past_key_values is not None:
|
1243 |
target_shape = past_key_values[0][0].shape[2] + 1
|
1244 |
attention_mask = torch.ones(
|