Skip to content

Commit 8b1b1f4

Browse files
train : add general name (#6752)
* llama : make general.name optional * train: Add 'general.name' to model metadata Signed-off-by: teleprint-me <[email protected]> --------- Signed-off-by: teleprint-me <[email protected]> Co-authored-by: Georgi Gerganov <[email protected]>
1 parent bca40e9 commit 8b1b1f4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/train-text-from-scratch/train-text-from-scratch.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct my_llama_model {
7373
static const char * LLM_KV_TRAINING_TYPE_TRAIN_MODEL = "train_model";
7474
static const char * LLM_KV_TRAINING_TYPE = "training.type";
7575

76+
static const char * LLM_KV_GENERAL_NAME = "general.name";
7677
static const char * LLM_KV_GENERAL_ARCHITECTURE = "general.architecture";
7778
static const char * LLM_KV_GENERAL_FILE_TYPE = "general.file_type";
7879

@@ -529,6 +530,7 @@ static void load_llama_model_gguf(struct gguf_context * fctx, struct ggml_contex
529530

530531
static void save_llama_model_gguf(struct gguf_context * fctx, const char * fn_vocab_model, struct my_llama_model * model) {
531532
const char * arch = "llama";
533+
532534
enum llama_ftype ftype = LLAMA_FTYPE_ALL_F32;
533535

534536
std::vector<char> keybuf;
@@ -540,6 +542,7 @@ static void save_llama_model_gguf(struct gguf_context * fctx, const char * fn_vo
540542

541543
// set arch
542544
gguf_set_val_str(fctx, LLM_KV_GENERAL_ARCHITECTURE, arch);
545+
gguf_set_val_str(fctx, LLM_KV_GENERAL_NAME, arch);
543546
gguf_set_val_u32(fctx, LLM_KV_GENERAL_FILE_TYPE, ftype);
544547

545548
// set hparams

0 commit comments

Comments
 (0)