Skip to content

Commit

Permalink
Support special tokens and not adding BOS to prompt in speculative
Browse files Browse the repository at this point in the history
  • Loading branch information
AutonomicPerfectionist committed Nov 10, 2023
1 parent df9d129 commit 5651be5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/speculative/speculative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@ int main(int argc, char ** argv) {
}
}

// tokenize the prompt

// Tokenize the prompt
const bool add_bos = llama_vocab_type(llama_get_model(ctx_tgt)) == LLAMA_VOCAB_TYPE_SPM;
LOG("add_bos: %d\n", add_bos);

std::vector<llama_token> inp;
inp = ::llama_tokenize(ctx_tgt, params.prompt, true);
inp = ::llama_tokenize(ctx_tgt, params.prompt, add_bos, true);

const int max_context_size = llama_n_ctx(ctx_tgt);
const int max_tokens_list_size = max_context_size - 4;
Expand Down

0 comments on commit 5651be5

Please sign in to comment.