Skip to content

Commit

Permalink
Fix Stopwords/Antiprompt (#248)
Browse files Browse the repository at this point in the history
Signed-off-by: 65a <65a@63bit.net>
  • Loading branch information
65a authored Oct 3, 2023
1 parent 79f9587 commit 6018c9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,17 @@ int llama_predict(void* params_ptr, void* state_pr, char* result, bool debug) {
: 0;

if (last_output.find(antiprompt, search_start_pos) != std::string::npos) {
is_antiprompt = true;
break;
}
}
}
}

// found antiprompt
if (is_antiprompt) {
break;
}

// end of text token
if (!embd.empty() && embd.back() == llama_token_eos(ctx)) {
Expand Down

0 comments on commit 6018c9d

Please sign in to comment.