Skip to content

Commit 52b9b9b

Browse files
committed
bugfix
1 parent fbbda7e commit 52b9b9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/main/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ int main(int argc, char ** argv) {
8585
params.prompt = gpt_random_prompt(rng);
8686
}
8787

88-
bool instruct_mode = params.instruct_prefix.empty() && params.instruct_suffix.empty();
88+
bool instruct_mode = !params.instruct_prefix.empty() || !params.instruct_suffix.empty();
8989

9090
// params.prompt = R"(// this function checks if the number n is prime
9191
//bool is_prime(int n) {)";
@@ -327,7 +327,7 @@ int main(int argc, char ** argv) {
327327
}
328328

329329
// replace end of text token with newline token when in interactive mode
330-
if (id == llama_token_eos() && params.interactive && instruct_mode) {
330+
if (id == llama_token_eos() && params.interactive && !instruct_mode) {
331331
id = llama_token_newline.front();
332332
if (params.antiprompt.size() != 0) {
333333
// tokenize and inject first reverse prompt

0 commit comments

Comments
 (0)