@@ -1673,28 +1673,19 @@ static void llm_load_hparams(
1673
1673
hparams.n_head_kv = hparams.n_head ;
1674
1674
GGUF_GET_KEY (ctx, hparams.n_head_kv , gguf_get_val_u32, GGUF_TYPE_UINT32, false , kv (LLM_KV_ATTENTION_HEAD_COUNT_KV));
1675
1675
1676
- // TODO: manually setting rope freq base and scale should override this
1677
- // FIXME: partial fix when the param specified is not the default value, but
1678
- // will not work for overriding the model value to the params default
1679
-
1680
1676
llama_context_params defaults = llama_context_default_params ();
1681
1677
1682
- // rope_freq_base
1683
- {
1684
- float ropebase = 10000 .0f ;
1685
- GGUF_GET_KEY (ctx, ropebase, gguf_get_val_f32, GGUF_TYPE_FLOAT32, false , kv (LLM_KV_ROPE_FREQ_BASE));
1686
- if (ropebase != 10000 .0f && rope_freq_base == defaults.rope_freq_base ) {
1687
- rope_freq_base = ropebase;
1688
- }
1678
+ // rope_freq_base (optional)
1679
+ if (rope_freq_base == 0 .0f ) {
1680
+ rope_freq_base = 10000 .0f ;
1681
+ GGUF_GET_KEY (ctx, rope_freq_base, gguf_get_val_f32, GGUF_TYPE_FLOAT32, false , kv (LLM_KV_ROPE_FREQ_BASE));
1689
1682
}
1690
1683
1691
1684
// rope_freq_scale (inverse of the kv) is optional
1692
- {
1685
+ if (rope_freq_scale == 0 . 0f ) {
1693
1686
float ropescale = 1 .0f ;
1694
1687
GGUF_GET_KEY (ctx, ropescale, gguf_get_val_f32, GGUF_TYPE_FLOAT32, false , kv (LLM_KV_ROPE_SCALE_LINEAR));
1695
- if (ropescale != 1 .0f && rope_freq_scale == defaults.rope_freq_scale ) {
1696
- rope_freq_scale = 1 .0f /ropescale;
1697
- }
1688
+ rope_freq_scale = 1 .0f /ropescale;
1698
1689
}
1699
1690
1700
1691
// sanity check for n_rot (optional)
@@ -6187,8 +6178,8 @@ struct llama_context_params llama_context_default_params() {
6187
6178
/* .n_gpu_layers =*/ 0 ,
6188
6179
/* .main_gpu =*/ 0 ,
6189
6180
/* .tensor_split =*/ nullptr ,
6190
- /* .rope_freq_base =*/ 10000 .0f ,
6191
- /* .rope_freq_scale =*/ 1 .0f ,
6181
+ /* .rope_freq_base =*/ 0 .0f ,
6182
+ /* .rope_freq_scale =*/ 0 .0f ,
6192
6183
/* .progress_callback =*/ nullptr ,
6193
6184
/* .progress_callback_user_data =*/ nullptr ,
6194
6185
/* .low_vram =*/ false ,
0 commit comments