Skip to content

Commit 5651be5

Browse files
Support special tokens and not adding BOS to prompt in speculative
1 parent df9d129 commit 5651be5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: examples/speculative/speculative.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,13 @@ int main(int argc, char ** argv) {
9494
}
9595
}
9696

97-
// tokenize the prompt
97+
98+
// Tokenize the prompt
99+
const bool add_bos = llama_vocab_type(llama_get_model(ctx_tgt)) == LLAMA_VOCAB_TYPE_SPM;
100+
LOG("add_bos: %d\n", add_bos);
101+
98102
std::vector<llama_token> inp;
99-
inp = ::llama_tokenize(ctx_tgt, params.prompt, true);
103+
inp = ::llama_tokenize(ctx_tgt, params.prompt, add_bos, true);
100104

101105
const int max_context_size = llama_n_ctx(ctx_tgt);
102106
const int max_tokens_list_size = max_context_size - 4;

0 commit comments

Comments
 (0)