Skip to content

Commit f999ff5

Browse files
author
ochafik
committed
alternative fix for gcc c vs. c++ weirdness
1 parent a58b9e5 commit f999ff5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/main/main.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,14 @@ int main(int argc, char ** argv) {
759759

760760
// check for reverse prompt using special tokens
761761
llama_token last_token = common_sampler_last(smpl);
762-
if (std::find(antiprompt_token.begin(), antiprompt_token.end(), (int32_t) last_token) != antiprompt_token.end()) {
763-
if (params.interactive) {
764-
is_interacting = true;
762+
for (auto token : antiprompt_token) {
763+
if (token == last_token) {
764+
if (params.interactive) {
765+
is_interacting = true;
766+
}
767+
is_antiprompt = true;
768+
break;
765769
}
766-
is_antiprompt = true;
767770
}
768771

769772
if (is_antiprompt) {

0 commit comments

Comments
 (0)