Skip to content

Commit ce89d8a

Browse files
authored
add --spm-infill option
1 parent 9c77ec1 commit ce89d8a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

common/common.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,10 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa
12851285
params.input_suffix = argv[i];
12861286
return true;
12871287
}
1288+
if (arg == "--spm-infill") {
1289+
params.spm_infill = true;
1290+
return true;
1291+
}
12881292
if (arg == "--grammar") {
12891293
if (++i >= argc) {
12901294
invalid_param = true;
@@ -1781,6 +1785,8 @@ void gpt_params_print_usage(int /*argc*/, char ** argv, const gpt_params & param
17811785
options.push_back({ "main infill", " --in-prefix-bos", "prefix BOS to user inputs, preceding the `--in-prefix` string" });
17821786
options.push_back({ "main infill", " --in-prefix STRING", "string to prefix user inputs with (default: empty)" });
17831787
options.push_back({ "main infill", " --in-suffix STRING", "string to suffix after user inputs with (default: empty)" });
1788+
options.push_back({ "server infill",
1789+
" --spm-infill", "use Suffix/Prefix/Middle pattern for infill (instead of Prefix/Suffix/Middle) as some models prefer this. (default: %s)", params.spm_infill ? "enabled" : "disabled" });
17841790

17851791
options.push_back({ "sampling" });
17861792
options.push_back({ "*", " --samplers SAMPLERS", "samplers that will be used for generation in the order, separated by \';\'\n"

common/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ struct gpt_params {
240240
std::string cvector_completions_file = "examples/cvector-generator/completions.txt";
241241
std::string cvector_positive_file = "examples/cvector-generator/positive.txt";
242242
std::string cvector_negative_file = "examples/cvector-generator/negative.txt";
243+
244+
bool spm_infill = false; // suffix/prefix/middle pattern for infill
243245
};
244246

245247
void gpt_params_handle_model_default(gpt_params & params);

0 commit comments

Comments
 (0)