Skip to content

Commit

Permalink
fix bug in sp
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-mb committed Sep 27, 2024
1 parent 549a22f commit 3b46e1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/llava/minicpmv-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ static void process_eval_image_embed_l(struct llava_context * ctx_llava, const s

if (sp == 0) {
std::memcpy(image_embed, buffer, token_len);
std::memcpy(image_embed + n_patches + 1, buffer+token_len, token_len);
std::memcpy(image_embed + (n_patches + 1) * token_len, buffer+token_len, token_len);
}
else if (sp == 1) {
std::memcpy(image_embed, buffer+token_len*2, token_len);
std::memcpy(image_embed+ n_patches + 1, buffer+token_len*3, token_len);
std::memcpy(image_embed + (n_patches + 1) * token_len, buffer+token_len*3, token_len);
}

std::memcpy(image_embed+token_len, embeds->embed + idx * clip_n_patches(ctx_llava->ctx_clip) * clip_n_mmproj_embd(ctx_llava->ctx_clip), clip_embd_nbytes(ctx_llava->ctx_clip));
Expand Down

0 comments on commit 3b46e1d

Please sign in to comment.