This commit is contained in:
yushihang 2025-02-09 22:56:17 +05:30 committed by GitHub
commit e80c485077
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -282,6 +282,7 @@ static bool encode_image_with_clip(clip_ctx * ctx_clip, int n_threads, const cli
if (!encoded) {
LOG_ERR("Unable to encode image - spatial_unpad - subimage %d of %d\n", (int) i+1, (int) img_res_v.size);
delete[] img_res_v.data; // 添加内存释放
return false;
}
const int64_t t_img_enc_steop_batch_us = ggml_time_us();
@ -322,6 +323,7 @@ static bool encode_image_with_clip(clip_ctx * ctx_clip, int n_threads, const cli
*n_img_pos = (pos * pos + 2);
if (!encoded){
LOG_ERR("Unable to encode image \n");
delete[] img_res_v.data; // 添加内存释放
return false;
}
}
@ -346,6 +348,7 @@ static bool encode_image_with_clip(clip_ctx * ctx_clip, int n_threads, const cli
const bool encoded = clip_image_encode(ctx_clip, n_threads, &img_res_v.data[i], image_embd_v[i]); // image data is in 3x336x336 format and will be converted to 336x336x3 inside
if (!encoded) {
LOG_ERR("Unable to encode image - spatial_unpad - subimage %d of %d\n", (int) i+1, (int) img_res_v.size);
delete[] img_res_v.data; // 添加内存释放
return false;
}
}