aboutsummaryrefslogtreecommitdiff
path: root/main.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 /main.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 'main.cpp')
-rw-r--r--main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index fbb43a8..4569ef2 100644
--- a/main.cpp
+++ b/main.cpp
@@ -254,6 +254,10 @@ int main(int argc, char ** argv) {
params.interactive = true;
}
+ if (params.interactive_start) {
+ params.interactive = true;
+ }
+
fprintf(stderr, "\n");
fprintf(stderr, "%s: prompt: '%s'\n", __func__, params.prompt.c_str());
fprintf(stderr, "%s: number of tokens in prompt = %zu\n", __func__, embd_inp.size());
@@ -296,7 +300,7 @@ int main(int argc, char ** argv) {
#endif
" - Press Return to return control to LLaMa.\n"
" - If you want to submit another line, end your input in '\\'.\n\n");
- is_interacting = true;
+ is_interacting = params.interactive_start;
}
int input_consumed = 0;