Skip to content

Commit 4282465

Browse files
committed
still does not work?
1 parent 4ac7940 commit 4282465

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

tools/llava/clip.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,18 +1204,14 @@ static ggml_cgraph * clip_image_build_graph_ultravox(clip_ctx * ctx, const clip_
12041204
// mid-norm
12051205
cur = ggml_rms_norm(ctx0, cur, 1e-6);
12061206
cur = ggml_mul(ctx0, cur, model.mm_norm_mid_w);
1207+
embeddings = cur;
12071208

12081209
// ffn out
12091210
cur = ggml_mul_mat(ctx0, model.mm_2_w, cur);
12101211

12111212
embeddings = cur;
12121213
}
12131214

1214-
embeddings = ggml_view_2d(ctx0, embeddings, 2048, n_step / 16,
1215-
ggml_row_size(embeddings->type, 2048), 0);
1216-
1217-
printf("shape of embd: %lld %lld %lld\n", embeddings->ne[0], embeddings->ne[1], embeddings->ne[2]);
1218-
12191215
// build the graph
12201216
ggml_build_forward_expand(gf, embeddings);
12211217

tools/llava/mtmd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ mtmd_context * mtmd_init_from_file(const char * mmproj_fname,
144144
clip_image_f32_batch * batch = clip_image_f32_batch_init();
145145
std::vector<float> mel(128 * 1024);
146146
clip_image_f32_batch_add_mel(batch, 128, 1024, mel.data());
147-
std::vector<float> output(64 * 2048);
147+
std::vector<float> output(64 * 2048, 0);
148148
clip_image_batch_encode(test->ctx_clip, 8, batch, output.data());
149149
for (int i = 0; i < 3; i++) printf("%f ", output[i]); printf("\n");
150150
for (int i = 0; i < 3; i++) printf("%f ", output[i+2048]); printf("\n");
151151
for (int i = 0; i < 3; i++) printf("%f ", output[i+2048*2]); printf("\n");
152152
float sum = 0.0;
153-
for (size_t i = 0; i < 1000; i++) sum += output[i];
153+
for (size_t i = 0; i < 64 * 2048; i++) sum += output[i];
154154
printf("sum: %f\n", sum);
155155
GGML_ABORT("test");
156156
} catch (const std::exception & e) {

0 commit comments

Comments
 (0)