@@ -1113,6 +1113,7 @@ struct llama_cparams {
11131113 float rope_freq_base;
11141114 float rope_freq_scale;
11151115
1116+ uint32_t n_yarn_orig_ctx;
11161117 // These hyperparameters are not exposed in GGUF, because all
11171118 // existing YaRN models use the same values for them.
11181119 float yarn_ext_factor;
@@ -3028,7 +3029,7 @@ static struct ggml_cgraph * llm_build_llama(
30283029 const int32_t n_embd = hparams.n_embd ;
30293030 const int32_t n_layer = hparams.n_layer ;
30303031 const int32_t n_ctx = cparams.n_ctx ;
3031- const int32_t n_orig_ctx = hparams .n_yarn_orig_ctx ;
3032+ const int32_t n_orig_ctx = cparams .n_yarn_orig_ctx ;
30323033 const int32_t n_head = hparams.n_head ;
30333034 const int32_t n_head_kv = hparams.n_head_kv ;
30343035 const int32_t n_embd_head = hparams.n_embd_head ();
@@ -3430,7 +3431,7 @@ static struct ggml_cgraph * llm_build_baichaun(
34303431 const int32_t n_embd = hparams.n_embd ;
34313432 const int32_t n_layer = hparams.n_layer ;
34323433 const int32_t n_ctx = cparams.n_ctx ;
3433- const int32_t n_orig_ctx = hparams .n_yarn_orig_ctx ;
3434+ const int32_t n_orig_ctx = cparams .n_yarn_orig_ctx ;
34343435 const int32_t n_head = hparams.n_head ;
34353436 const int32_t n_head_kv = hparams.n_head_kv ;
34363437 const int32_t n_embd_head = hparams.n_embd_head ();
@@ -4194,7 +4195,7 @@ static struct ggml_cgraph * llm_build_falcon(
41944195 const int32_t n_embd = hparams.n_embd ;
41954196 const int32_t n_layer = hparams.n_layer ;
41964197 const int32_t n_ctx = cparams.n_ctx ;
4197- const int32_t n_orig_ctx = hparams .n_yarn_orig_ctx ;
4198+ const int32_t n_orig_ctx = cparams .n_yarn_orig_ctx ;
41984199 const int32_t n_head = hparams.n_head ;
41994200 const int32_t n_head_kv = hparams.n_head_kv ;
42004201 const int32_t n_embd_head = hparams.n_embd_head ();
@@ -4818,7 +4819,7 @@ static struct ggml_cgraph * llm_build_persimmon(
48184819 const int64_t n_embd = hparams.n_embd ;
48194820 const int64_t n_layer = hparams.n_layer ;
48204821 const int64_t n_ctx = cparams.n_ctx ;
4821- const int32_t n_orig_ctx = hparams .n_yarn_orig_ctx ;
4822+ const int32_t n_orig_ctx = cparams .n_yarn_orig_ctx ;
48224823 const int64_t n_head_kv = hparams.n_head_kv ;
48234824 const int64_t n_head = hparams.n_head ;
48244825 const int64_t n_embd_head = hparams.n_embd_head ();
@@ -8676,6 +8677,7 @@ struct llama_context * llama_new_context_with_model(
86768677 cparams.mul_mat_q = params.mul_mat_q ;
86778678
86788679 cparams.n_ctx = params.n_ctx == 0 ? hparams.n_ctx_train : params.n_ctx ;
8680+ cparams.n_yarn_orig_ctx = params.yarn_orig_ctx == 0 ? hparams.n_ctx_train : params.yarn_orig_ctx ;
86798681 cparams.rope_freq_base = params.rope_freq_base == 0 .0f ? hparams.rope_freq_base_train : params.rope_freq_base ;
86808682 cparams.rope_freq_scale = params.rope_freq_scale == 0 .0f ? hparams.rope_freq_scale_train : params.rope_freq_scale ;
86818683
0 commit comments