From 38d0e1da9a83c941afe938f2d3878f01d28f33d1 Mon Sep 17 00:00:00 2001 From: ngxson Date: Thu, 28 Mar 2024 00:18:11 +0100 Subject: [PATCH] remove next_metadata_size --- examples/gguf-split/gguf-split.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/gguf-split/gguf-split.cpp b/examples/gguf-split/gguf-split.cpp index 7b67c0b57..24acbf02a 100644 --- a/examples/gguf-split/gguf-split.cpp +++ b/examples/gguf-split/gguf-split.cpp @@ -226,13 +226,10 @@ struct split_strategy { size_t curr_tensors_size = 0; // current size by counting only tensors size (without metadata) for (int i = 0; i < n_tensors; ++i) { struct ggml_tensor * t = ggml_get_tensor(ctx_meta, gguf_get_tensor_name(ctx_gguf, i)); - // calculate the "imaginary" size including this tensor + // calculate the "imaginary" size = the current size + next tensor size size_t n_bytes = GGML_PAD(ggml_nbytes(t), GGUF_DEFAULT_ALIGNMENT); size_t next_tensors_size = curr_tensors_size + n_bytes; - size_t next_metadata_size = gguf_get_meta_size(ctx_out) - + GGUF_DEFAULT_ALIGNMENT - + sizeof(struct ggml_tensor *); // not sure if we're missing something - if (should_split(i, next_tensors_size + next_metadata_size)) { + if (should_split(i, next_tensors_size)) { new_ctx_out(); curr_tensors_size = n_bytes; } else {