Skip to content

Commit adef817

Browse files
authored
server : allow setting --reverse-prompt arg (ggml-org#14799)
Signed-off-by: Molly Sophia <[email protected]>
1 parent 48b86c4 commit adef817

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

common/arg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
16121612
[](common_params & params, const std::string & value) {
16131613
params.antiprompt.emplace_back(value);
16141614
}
1615-
).set_examples({LLAMA_EXAMPLE_MAIN}));
1615+
).set_examples({LLAMA_EXAMPLE_MAIN, LLAMA_EXAMPLE_SERVER}));
16161616
add_opt(common_arg(
16171617
{"-sp", "--special"},
16181618
string_format("special tokens output enabled (default: %s)", params.special ? "true" : "false"),

tools/server/server.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ struct server_task {
253253
defaults.sampling = params_base.sampling;
254254
defaults.speculative = params_base.speculative;
255255
defaults.n_keep = params_base.n_keep;
256+
defaults.antiprompt = params_base.antiprompt;
256257

257258
// enabling this will output extra debug information in the HTTP responses from the server
258259
params.verbose = params_base.verbosity > 9;
@@ -490,6 +491,10 @@ struct server_task {
490491
}
491492
}
492493
}
494+
// set reverse prompt from cli args if not set in the request
495+
if (params.antiprompt.empty()) {
496+
params.antiprompt = defaults.antiprompt;
497+
}
493498
}
494499

495500
{

0 commit comments

Comments
 (0)