aboutsummaryrefslogtreecommitdiff
path: root/utils.cpp
diff options
context:
space:
mode:
authortjohnman <tjohnman@users.noreply.github.com>2023-03-22 18:16:35 +0100
committerGitHub <noreply@github.com>2023-03-22 19:16:35 +0200
commit305ba6f0e6daa3796aad9dd18053a1945dd4cc58 (patch)
treede8daef4c068615aacbad4ffff1c2350a81deac9 /utils.cpp
parent4122dffff958cd137175b58f1f27c0913528d7ba (diff)
Don't force immediate interactive without `-i` (#354)
* Don't force immediate interactive without -i Sometimes we might want to use a reverse prompt but we want to let the model generate tokens right after the initial prompt. So we don't force user input mode if the -i flag wasn't specified and instead let it run until we encounter the reverse prompt. This gives use some more flexibility, since it doesn't force the user to enter a newline if they want to let the model generate text right after the initial prompt and only be asked for input if the reverse prompt is encountered. The `--interactive-first` flag is reintroduced to force the old behavior. `-r` behaves like `-i` plus introduces a reverse prompt (it can be specified more than once). * Update help output. --------- Co-authored-by: Johnman <tjohnman@github>
Diffstat (limited to 'utils.cpp')
-rw-r--r--utils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils.cpp b/utils.cpp
index 3909c97..1d5309c 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -63,6 +63,8 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
params.model = argv[++i];
} else if (arg == "-i" || arg == "--interactive") {
params.interactive = true;
+ } else if (arg == "--interactive-first") {
+ params.interactive_start = true;
} else if (arg == "-ins" || arg == "--instruct") {
params.instruct = true;
} else if (arg == "--color") {
@@ -96,9 +98,10 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
fprintf(stderr, "options:\n");
fprintf(stderr, " -h, --help show this help message and exit\n");
fprintf(stderr, " -i, --interactive run in interactive mode\n");
+ fprintf(stderr, " --interactive-first run in interactive mode and wait for input right away\n");
fprintf(stderr, " -ins, --instruct run in instruction mode (use with Alpaca models)\n");
fprintf(stderr, " -r PROMPT, --reverse-prompt PROMPT\n");
- fprintf(stderr, " in interactive mode, poll user input upon seeing PROMPT (can be\n");
+ fprintf(stderr, " run in interactive mode and poll user input upon seeing PROMPT (can be\n");
fprintf(stderr, " specified more than once for multiple prompts).\n");
fprintf(stderr, " --color colorise output to distinguish prompt and user input from generations\n");
fprintf(stderr, " -s SEED, --seed SEED RNG seed (default: -1, use random seed for <= 0)\n");