@@ -88,7 +88,6 @@ static struct clip_image_grid_shape get_anyres_image_grid_shape(const std::pair<
88
88
// Take the image segments in a grid configuration and return the embeddings and the number of embeddings into preallocated memory (image_embd_out)
89
89
static bool clip_llava_handle_patches (clip_ctx * ctx_clip, std::vector<float *> & image_embd_v, struct clip_image_grid_shape grid_shape, float * image_embd_out, int * n_img_pos_out) {
90
90
struct {
91
- struct ggml_tensor * newline;
92
91
struct ggml_context * ctx;
93
92
} model;
94
93
@@ -150,20 +149,6 @@ static bool clip_llava_handle_patches(clip_ctx * ctx_clip, std::vector<float *>
150
149
151
150
model.ctx = ggml_init (params);
152
151
153
- ggml_tensor * newline_tmp = clip_get_newline_tensor (ctx_clip);
154
- model.newline = ggml_new_tensor_1d (model.ctx , GGML_TYPE_F32, newline_tmp->ne [0 ]);
155
- if (newline_tmp->backend != GGML_BACKEND_TYPE_CPU) {
156
- if (newline_tmp->buffer == NULL ) {
157
- LOG_TEE (" newline_tmp tensor buffer is NULL\n " );
158
- }
159
- ggml_backend_tensor_get (newline_tmp, model.newline ->data , 0 , ggml_nbytes (newline_tmp));
160
- } else {
161
- model.newline ->data = newline_tmp->data ;
162
- if (model.newline ->data == NULL ) {
163
- LOG_TEE (" newline_tmp tensor data is NULL\n " );
164
- }
165
- }
166
-
167
152
struct ggml_tensor * image_features = ggml_new_tensor_3d (model.ctx , GGML_TYPE_F32, clip_n_mmproj_embd (ctx_clip), clip_n_patches (ctx_clip), num_images - 1 ); // example: 4096 x 576 x 4
168
153
// ggml_tensor_printf(image_features,"image_features",__LINE__,false,false);
169
154
// fill it with the image embeddings, ignoring the base
0 commit comments