Skip to content

Commit 749e0d2

Browse files
authored
mtmd : fix 32-bit narrowing issue in export-lora and mtmd clip (#14503)
* [fix] Fix 32-bit narrowing issue in export-lora and mtmd clip * Update export-lora.cpp * Update clip.cpp * Update export-lora.cpp * format: use space to replace tab
1 parent 64bf1c3 commit 749e0d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/export-lora/export-lora.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct lora_merge_ctx {
148148

149149
ctx_out = gguf_init_empty();
150150
struct ggml_init_params params = {
151-
/*.mem_size =*/ gguf_get_n_tensors(base_model.ctx_gguf)*ggml_tensor_overhead(),
151+
/*.mem_size =*/ static_cast<size_t>(gguf_get_n_tensors(base_model.ctx_gguf)*ggml_tensor_overhead()),
152152
/*.mem_buffer =*/ NULL,
153153
/*.no_alloc =*/ true,
154154
};

tools/mtmd/clip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ struct clip_model_loader {
23152315

23162316
// create data context
23172317
struct ggml_init_params params = {
2318-
/*.mem_size =*/ (gguf_get_n_tensors(ctx_gguf.get()) + 1) * ggml_tensor_overhead(),
2318+
/*.mem_size =*/ static_cast<size_t>(gguf_get_n_tensors(ctx_gguf.get()) + 1) * ggml_tensor_overhead(),
23192319
/*.mem_buffer =*/ NULL,
23202320
/*.no_alloc =*/ true,
23212321
};

0 commit comments

Comments
 (0)