| 1411 | // |
| 1412 | |
| 1413 | static void mtmd_debug_encode_impl(mtmd_context * ctx, clip_ctx * ctx_clip, clip_image_f32 & image) { |
| 1414 | clip_set_debug_output_embeddings(ctx_clip, true); |
| 1415 | int n_mmproj_embd = clip_n_mmproj_embd(ctx_clip); |
| 1416 | int n_tokens = clip_n_output_tokens(ctx_clip, &image); |
| 1417 | std::vector<float> embd_output(n_tokens * n_mmproj_embd, 0.0f); |
| 1418 | bool ok = clip_image_encode( |
| 1419 | ctx_clip, |
| 1420 | ctx->n_threads, |
| 1421 | &image, |
| 1422 | embd_output.data()); |
| 1423 | if (!ok) { |
| 1424 | LOG_ERR("%s: failed to encode image\n", __func__); |
| 1425 | } |
| 1426 | } |
| 1427 | |
| 1428 | void mtmd_debug_encode_image(mtmd_context * ctx, const std::vector<std::vector<float>> & image) { |
| 1429 | if (!ctx->ctx_v) { |
no test coverage detected