Skip to content

Commit 78efe60

Browse files
authored
add -st / --single-turn
1 parent 07f9d4c commit 78efe60

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

common/arg.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,15 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
949949
params.conversation_mode = COMMON_CONVERSATION_MODE_DISABLED;
950950
}
951951
).set_examples({LLAMA_EXAMPLE_MAIN}));
952+
add_opt(common_arg(
953+
{"-st", "--single-turn"},
954+
"run conversation for a single turn only, then exit when done\n"
955+
"will not be interactive if first turn is predefined with --prompt\n"
956+
"(default: false)",
957+
[](common_params & params) {
958+
params.single_turn = true;
959+
}
960+
).set_examples({LLAMA_EXAMPLE_MAIN}));
952961
add_opt(common_arg(
953962
{"-i", "--interactive"},
954963
string_format("run in interactive mode (default: %s)", params.interactive ? "true" : "false"),

common/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ struct common_params {
326326
bool warmup = true; // warmup run
327327
bool check_tensors = false; // validate tensor data
328328

329+
bool single_turn = false; // single turn chat conversation
330+
329331
ggml_type cache_type_k = GGML_TYPE_F16; // KV cache data type for the K
330332
ggml_type cache_type_v = GGML_TYPE_F16; // KV cache data type for the V
331333

0 commit comments

Comments
 (0)