handle freq_base_train

This commit is contained in:
Concedo 2023-10-24 23:44:22 +08:00
parent 6a4d9c26e1
commit 839fc6dac8
3 changed files with 13 additions and 0 deletions

View file

@ -290,6 +290,14 @@ void print_tok_vec(std::vector<float> &embd)
}
int filever = gguf_get_version(ctx);
fileformatmeta->fileversion = filever;
//try to adapt if the rope_freq_base_train exceeds the auto one
fkey = modelarch+".rope.freq_base";
auto keyidx = gguf_find_key(ctx, fkey.c_str());
if (keyidx != -1) {
float fbt = gguf_get_val_f32(ctx, keyidx);
fileformatmeta->freq_base_train = (fbt > 1.0f ? fbt : 0.0f);
}
}
gguf_free(ctx);
}