Update modeling_colgranitevision.py
Browse files
modeling_colgranitevision.py
CHANGED
@@ -11,13 +11,13 @@ from .colgranitevision_config import ColGraniteVisionConfig
|
|
11 |
|
12 |
|
13 |
class LlavaNextWithCustomPacking(LlavaNextForConditionalGeneration):
|
|
|
14 |
def pack_image_features(
|
15 |
self,
|
16 |
image_features,
|
17 |
image_sizes,
|
18 |
vision_feature_select_strategy,
|
19 |
-
image_newline=None
|
20 |
-
base_image_feature_location="last",
|
21 |
):
|
22 |
"""
|
23 |
Reshape, unpad and then pack each image_feature into a single image_features tensor containing all visual vectors.
|
@@ -37,6 +37,7 @@ class LlavaNextWithCustomPacking(LlavaNextForConditionalGeneration):
|
|
37 |
token length of each image in image_features
|
38 |
"""
|
39 |
|
|
|
40 |
new_image_features = []
|
41 |
feature_lens = []
|
42 |
for image_idx, image_feature in enumerate(image_features):
|
|
|
11 |
|
12 |
|
13 |
class LlavaNextWithCustomPacking(LlavaNextForConditionalGeneration):
|
14 |
+
|
15 |
def pack_image_features(
|
16 |
self,
|
17 |
image_features,
|
18 |
image_sizes,
|
19 |
vision_feature_select_strategy,
|
20 |
+
image_newline=None
|
|
|
21 |
):
|
22 |
"""
|
23 |
Reshape, unpad and then pack each image_feature into a single image_features tensor containing all visual vectors.
|
|
|
37 |
token length of each image in image_features
|
38 |
"""
|
39 |
|
40 |
+
base_image_feature_location = self.config.base_image_feature_location
|
41 |
new_image_features = []
|
42 |
feature_lens = []
|
43 |
for image_idx, image_feature in enumerate(image_features):
|