diff --git a/examples/mtmd/clip.cpp b/examples/mtmd/clip.cpp index 2eb3fdf6..81644040 100644 --- a/examples/mtmd/clip.cpp +++ b/examples/mtmd/clip.cpp @@ -1099,7 +1099,9 @@ struct clip_graph { model.mm_1_w, model.mm_1_b, ffn_op_type::FFN_GELU, -1); - embeddings = ggml_concat(ctx0, embeddings, deepstack_features, 0); // concat along the feature dimension + if (deepstack_features) { + embeddings = ggml_concat(ctx0, embeddings, deepstack_features, 0); // concat along the feature dimension + } // build the graph ggml_build_forward_expand(gf, embeddings);