@@ -194,6 +194,18 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
194
194
break ;
195
195
}
196
196
params.rope_freq_scale = std::stof (argv[i]);
197
+ } else if (arg == " --rope-ntk-factor" ) {
198
+ if (++i >= argc) {
199
+ invalid_param = true ;
200
+ break ;
201
+ }
202
+ params.rope_ntk_factor = std::stof (argv[i]);
203
+ } else if (arg == " --rope-ext-factor" ) {
204
+ if (++i >= argc) {
205
+ invalid_param = true ;
206
+ break ;
207
+ }
208
+ params.rope_ext_factor = std::stof (argv[i]);
197
209
} else if (arg == " --memory-f32" ) {
198
210
params.memory_f16 = false ;
199
211
} else if (arg == " --top-p" ) {
@@ -566,6 +578,8 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
566
578
fprintf (stdout, " --cfg-scale N strength of guidance (default: %f, 1.0 = disable)\n " , params.cfg_scale );
567
579
fprintf (stdout, " --rope-freq-base N RoPE base frequency (default: %.1f)\n " , params.rope_freq_base );
568
580
fprintf (stdout, " --rope-freq-scale N RoPE frequency scaling factor (default: %g)\n " , params.rope_freq_scale );
581
+ fprintf (stdout, " --rope-ntk-factor N RoPE NTK mix factor (default: %.1f)\n " , params.rope_ntk_factor );
582
+ fprintf (stdout, " --rope-ext-factor N RoPE extrapolation mix factor (default: %.1f)\n " , params.rope_ext_factor );
569
583
fprintf (stdout, " --ignore-eos ignore end of stream token and continue generating (implies --logit-bias 2-inf)\n " );
570
584
fprintf (stdout, " --no-penalize-nl do not penalize newline token\n " );
571
585
fprintf (stdout, " --memory-f32 use f32 instead of f16 for memory key+value (default: disabled)\n " );
@@ -657,6 +671,8 @@ struct llama_context_params llama_context_params_from_gpt_params(const gpt_param
657
671
lparams.embedding = params.embedding ;
658
672
lparams.rope_freq_base = params.rope_freq_base ;
659
673
lparams.rope_freq_scale = params.rope_freq_scale ;
674
+ lparams.rope_ntk_factor = params.rope_ntk_factor ;
675
+ lparams.rope_ext_factor = params.rope_ext_factor ;
660
676
661
677
return lparams;
662
678
}
0 commit comments