Apply suggestions from code review
This commit is contained in:
parent
0d3ad163f0
commit
0536d004cb
3 changed files with 16 additions and 17 deletions
|
@ -2376,9 +2376,8 @@ void clip_free(clip_ctx * ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t clip_embd_nbytes(const struct clip_ctx * ctx) {
|
size_t clip_embd_nbytes(const struct clip_ctx * ctx) {
|
||||||
if(ctx->has_glm_projector)
|
int extra_tokens = ctx->has_glm_projector ? 2 : 0;
|
||||||
return (clip_n_patches(ctx)+2) * clip_n_mmproj_embd(ctx) * sizeof(float);
|
return (clip_n_patches(ctx) + extra_tokens) * clip_n_mmproj_embd(ctx) * sizeof(float);
|
||||||
return clip_n_patches(ctx) * clip_n_mmproj_embd(ctx) * sizeof(float);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t clip_embd_nbytes_by_img(const struct clip_ctx * ctx, int img_h, int img_w) {
|
size_t clip_embd_nbytes_by_img(const struct clip_ctx * ctx, int img_h, int img_w) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue