@@ -26,7 +26,7 @@ enum split_operation : uint8_t {
26
26
SPLIT_OP_MERGE,
27
27
};
28
28
29
- static const char * const LLM_KV_GENERAL_SPLIT_N_TENSORS = " split.tensors.count" ;
29
+ static const char * const LLM_KV_SPLIT_TENSORS_COUNT = " split.tensors.count" ;
30
30
31
31
struct split_params {
32
32
split_operation operation = SPLIT_OP_SPLIT;
@@ -175,9 +175,9 @@ struct split_strategy {
175
175
if (i_split == 0 ) {
176
176
gguf_set_kv (ctx_out, ctx_gguf);
177
177
}
178
- gguf_set_val_u16 (ctx_out, LLM_KV_GENERAL_SPLIT_I_SPLIT, i_split);
179
- gguf_set_val_u16 (ctx_out, LLM_KV_GENERAL_SPLIT_N_SPLIT, n_split);
180
- gguf_set_val_i32 (ctx_out, LLM_KV_GENERAL_SPLIT_N_TENSORS, n_tensors);
178
+ gguf_set_val_u16 (ctx_out, LLM_KV_SPLIT_NO, i_split);
179
+ gguf_set_val_u16 (ctx_out, LLM_KV_SPLIT_COUNT, n_split);
180
+ gguf_set_val_i32 (ctx_out, LLM_KV_SPLIT_TENSORS_COUNT, n_tensors);
181
181
182
182
// populate the original tensors, so we get an initial metadata
183
183
for (int i = i_split * params.n_split_tensors ; i < n_tensors && i < (i_split + 1 ) * params.n_split_tensors ; ++i) {
@@ -326,12 +326,12 @@ static void gguf_merge(const split_params & split_params) {
326
326
ctx_metas.push_back (ctx_meta);
327
327
328
328
if (i_split == 0 ) {
329
- auto key_n_split = gguf_find_key (ctx_gguf, LLM_KV_GENERAL_SPLIT_N_SPLIT );
329
+ auto key_n_split = gguf_find_key (ctx_gguf, LLM_KV_SPLIT_COUNT );
330
330
if (key_n_split < 0 ) {
331
331
fprintf (stderr,
332
332
" \n %s: input file does not contain %s metadata\n " ,
333
333
__func__,
334
- LLM_KV_GENERAL_SPLIT_N_SPLIT );
334
+ LLM_KV_SPLIT_COUNT );
335
335
gguf_free (ctx_gguf);
336
336
ggml_free (ctx_meta);
337
337
gguf_free (ctx_out);
@@ -353,7 +353,7 @@ static void gguf_merge(const split_params & split_params) {
353
353
}
354
354
355
355
// Verify the file naming and extract split_prefix
356
- if (!llama_split_prefix (split_prefix, split_path, strlen (split_path) , i_split, n_split)) {
356
+ if (!llama_split_prefix (split_prefix, sizeof (split_prefix), split_path , i_split, n_split)) {
357
357
fprintf (stderr, " \n %s: unexpected input file name: %s"
358
358
" i_split=%d"
359
359
" n_split=%d\n " , __func__,
@@ -366,7 +366,7 @@ static void gguf_merge(const split_params & split_params) {
366
366
}
367
367
368
368
// Do not trigger merge if we try to merge again the output
369
- gguf_set_val_u16 (ctx_gguf, LLM_KV_GENERAL_SPLIT_N_SPLIT , 0 );
369
+ gguf_set_val_u16 (ctx_gguf, LLM_KV_SPLIT_COUNT , 0 );
370
370
371
371
// Set metadata from the first split
372
372
gguf_set_kv (ctx_out, ctx_gguf);
0 commit comments