@@ -1617,28 +1617,19 @@ static void llm_load_hparams(
1617
1617
hparams.n_head_kv = hparams.n_head ;
1618
1618
GGUF_GET_KEY (ctx, hparams.n_head_kv , gguf_get_val_u32, GGUF_TYPE_UINT32, false , kv (LLM_KV_ATTENTION_HEAD_COUNT_KV));
1619
1619
1620
- // TODO: manually setting rope freq base and scale should override this
1621
- // FIXME: partial fix when the param specified is not the default value, but
1622
- // will not work for overriding the model value to the params default
1623
-
1624
1620
llama_context_params defaults = llama_context_default_params ();
1625
1621
1626
- // rope_freq_base
1627
- {
1628
- float ropebase = 10000 .0f ;
1629
- GGUF_GET_KEY (ctx, ropebase, gguf_get_val_f32, GGUF_TYPE_FLOAT32, false , kv (LLM_KV_ROPE_FREQ_BASE));
1630
- if (ropebase != 10000 .0f && rope_freq_base == defaults.rope_freq_base ) {
1631
- rope_freq_base = ropebase;
1632
- }
1622
+ // rope_freq_base (optional)
1623
+ if (rope_freq_base == 0 .0f ) {
1624
+ rope_freq_base = 10000 .0f ;
1625
+ GGUF_GET_KEY (ctx, rope_freq_base, gguf_get_val_f32, GGUF_TYPE_FLOAT32, false , kv (LLM_KV_ROPE_FREQ_BASE));
1633
1626
}
1634
1627
1635
1628
// rope_freq_scale (inverse of the kv) is optional
1636
- {
1629
+ if (rope_freq_scale == 0 . 0f ) {
1637
1630
float ropescale = 1 .0f ;
1638
1631
GGUF_GET_KEY (ctx, ropescale, gguf_get_val_f32, GGUF_TYPE_FLOAT32, false , kv (LLM_KV_ROPE_SCALE_LINEAR));
1639
- if (ropescale != 1 .0f && rope_freq_scale == defaults.rope_freq_scale ) {
1640
- rope_freq_scale = 1 .0f /ropescale;
1641
- }
1632
+ rope_freq_scale = 1 .0f /ropescale;
1642
1633
}
1643
1634
1644
1635
// sanity check for n_rot (optional)
@@ -5349,8 +5340,8 @@ struct llama_context_params llama_context_default_params() {
5349
5340
/* .n_gpu_layers =*/ 0 ,
5350
5341
/* .main_gpu =*/ 0 ,
5351
5342
/* .tensor_split =*/ nullptr ,
5352
- /* .rope_freq_base =*/ 10000 .0f ,
5353
- /* .rope_freq_scale =*/ 1 .0f ,
5343
+ /* .rope_freq_base =*/ 0 .0f ,
5344
+ /* .rope_freq_scale =*/ 0 .0f ,
5354
5345
/* .progress_callback =*/ nullptr ,
5355
5346
/* .progress_callback_user_data =*/ nullptr ,
5356
5347
/* .low_vram =*/ false ,
0 commit comments