@@ -180,6 +180,18 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
180
180
break ;
181
181
}
182
182
params.rope_freq_scale = std::stof (argv[i]);
183
+ } else if (arg == " --rope-ntk-factor" ) {
184
+ if (++i >= argc) {
185
+ invalid_param = true ;
186
+ break ;
187
+ }
188
+ params.rope_ntk_factor = std::stof (argv[i]);
189
+ } else if (arg == " --rope-extrapolation-factor" ) {
190
+ if (++i >= argc) {
191
+ invalid_param = true ;
192
+ break ;
193
+ }
194
+ params.rope_extrapolation_factor = std::stof (argv[i]);
183
195
} else if (arg == " --memory-f32" ) {
184
196
params.memory_f16 = false ;
185
197
} else if (arg == " --top-p" ) {
@@ -513,6 +525,9 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
513
525
fprintf (stderr, " -c N, --ctx-size N size of the prompt context (default: %d)\n " , params.n_ctx );
514
526
fprintf (stderr, " --rope-freq-base N RoPE base frequency (default: %.1f)\n " , params.rope_freq_base );
515
527
fprintf (stderr, " --rope-freq-scale N RoPE frequency scaling factor (default: %g)\n " , params.rope_freq_scale );
528
+ fprintf (stderr, " --rope-ntk-factor N RoPE NTK mix factor (default: %.1f)\n " , params.rope_ntk_factor );
529
+ fprintf (stderr, " --rope-extrapolation-factor N\n " );
530
+ fprintf (stderr, " RoPE extrapolation mix factor (default: %.1f)\n " , params.rope_extrapolation_factor );
516
531
fprintf (stderr, " --ignore-eos ignore end of stream token and continue generating (implies --logit-bias 2-inf)\n " );
517
532
fprintf (stderr, " --no-penalize-nl do not penalize newline token\n " );
518
533
fprintf (stderr, " --memory-f32 use f32 instead of f16 for memory key+value (default: disabled)\n " );
@@ -596,6 +611,8 @@ struct llama_context_params llama_context_params_from_gpt_params(const gpt_param
596
611
lparams.embedding = params.embedding ;
597
612
lparams.rope_freq_base = params.rope_freq_base ;
598
613
lparams.rope_freq_scale = params.rope_freq_scale ;
614
+ lparams.rope_ntk_factor = params.rope_ntk_factor ;
615
+ lparams.rope_extrapolation_factor = params.rope_extrapolation_factor ;
599
616
600
617
return lparams;
601
618
}
0 commit comments