Skip to content

Commit

Permalink
override simple, for my tests and use case
Browse files Browse the repository at this point in the history
  • Loading branch information
bachittle committed Mar 7, 2024
1 parent 6cdabe6 commit 6183d9f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions examples/simple/simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ int main(int argc, char ** argv) {
}

if (params.prompt.empty()) {
params.prompt = "Hello my name is";
params.prompt = R"(<bos><start_of_turn>user
Hello!<end_of_turn>
<start_of_turn>model
)";
}

// total length of the sequence including the prompt
const int n_len = 32;
const int n_len = 128;

// init LLM

Expand Down Expand Up @@ -85,10 +88,10 @@ int main(int argc, char ** argv) {
fprintf(stderr, "\n");

for (auto id : tokens_list) {
fprintf(stderr, "%s", llama_token_to_piece(ctx, id).c_str());
fprintf(stdout, "%s", llama_token_to_piece(ctx, id).c_str());
}

fflush(stderr);
fflush(stdout);

// create a llama_batch with size 512
// we use this object to submit token data for decoding
Expand Down Expand Up @@ -140,7 +143,8 @@ int main(int argc, char ** argv) {
break;
}

LOG_TEE("%s", llama_token_to_piece(ctx, new_token_id).c_str());
// LOG_TEE("%s", llama_token_to_piece(ctx, new_token_id).c_str());
fprintf(stdout, "%s", llama_token_to_piece(ctx, new_token_id).c_str());
fflush(stdout);

// prepare the next batch
Expand Down

0 comments on commit 6183d9f

Please sign in to comment.