8000 fix antipromt reaction, app stops if not in a interacting mode · ggml-org/llama.cpp@adae40e · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit adae40e

Browse files
committed
fix antipromt reaction, app stops if not in a interacting mode
1 parent aad4859 commit adae40e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/main/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,16 @@ int main(int argc, char ** argv) {
517517

518518
is_antiprompt = false;
519519
// Check if each of the reverse prompts appears at the end of the output.
520+
bool need_stop=false;
520521
for (std::string & antiprompt : params.antiprompt) {
521522
if (last_output.find(antiprompt.c_str(), last_output.length() - antiprompt.length(), antiprompt.length()) != std::string::npos) {
522-
is_interacting = true;
523+
//is_interacting = true;
524+
need_stop=true;
523525
is_antiprompt = true;
524526
break;
525527
}
526528
}
529+
if(need_stop==true&&is_interacting==false) break; // exit if not in interactive mode
527530
}
528531

529532
if (n_past > 0 && is_interacting) {

0 commit comments

Comments
 (0)
0