Insert single space in front of the prompt

- this is to match original llama tokenizer behavior
This commit is contained in:
Jakub Horak 2023-03-17 18:08:03 +01:00
parent 7e1041a730
commit 7566d1ab9b

View file

@ -845,6 +845,8 @@ int main(int argc, char ** argv) {
std::vector<float> logits;
// Add a space in front of the first character to match OG llama tokenizer behavior
params.prompt.insert(0, 1, ' ');
// tokenize the prompt
std::vector<gpt_vocab::id> embd_inp = ::llama_tokenize(vocab, params.prompt, true);