Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
aroidzap committed Apr 9, 2023
1 parent fbbda7e commit 52b9b9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int main(int argc, char ** argv) {
params.prompt = gpt_random_prompt(rng);
}

bool instruct_mode = params.instruct_prefix.empty() && params.instruct_suffix.empty();
bool instruct_mode = !params.instruct_prefix.empty() || !params.instruct_suffix.empty();

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

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

0 comments on commit 52b9b9b

Please sign in to comment.