Skip to content

Commit

Permalink
Insert single space in front of the prompt
Browse files Browse the repository at this point in the history
- this is to match original llama tokenizer behavior
  • Loading branch information
jxhor committed Mar 17, 2023
1 parent 7e1041a commit 7566d1a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7566d1a

Please sign in to comment.