Skip to content

Commit 77d9a8a

Browse files
author
Johnman
committed
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.
1 parent 8cf9f34 commit 77d9a8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,8 @@ int main(int argc, char ** argv) {
885885
antipromptv_inp.push_back(::llama_tokenize(vocab, antiprompt, false));
886886
}
887887

888+
const bool initially_interacting = params.interactive;
889+
888890
// enable interactive mode if reverse prompt is specified
889891
if (antipromptv_inp.size() != 0) {
890892
params.interactive = true;
@@ -942,7 +944,7 @@ int main(int argc, char ** argv) {
942944
#endif
943945
" - Press Return to return control to LLaMa.\n"
944946
" - If you want to submit another line, end your input in '\\'.\n\n");
945-
is_interacting = true;
947+
is_interacting = initially_interacting;
946948
}
947949

948950
int input_consumed = 0;

0 commit comments

Comments
 (0)