Skip to content

Commit

Permalink
account for space prefix character
Browse files Browse the repository at this point in the history
  • Loading branch information
CISC authored Jun 26, 2024
1 parent c70d117 commit b2b9bd8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5152,10 +5152,10 @@ static void llm_load_vocab(
if (gen_name.find("code") != std::string::npos) {
if (model.arch == LLM_ARCH_LLAMA
&& 32010 < vocab.id_to_token.size()
&& vocab.id_to_token[32007].text == "<PRE>"
&& vocab.id_to_token[32008].text == "<SUF>"
&& vocab.id_to_token[32009].text == "<MID>"
&& vocab.id_to_token[32010].text == "<EOT>") {
&& vocab.id_to_token[32007].text.ends_with("<PRE>")
&& vocab.id_to_token[32008].text.ends_with("<SUF>")
&& vocab.id_to_token[32009].text.ends_with("<MID>")
&& vocab.id_to_token[32010].text.ends_with("<EOT>")) {
vocab.special_prefix_id = 32007;
vocab.special_suffix_id = 32008;
vocab.special_middle_id = 32009;
Expand Down

0 comments on commit b2b9bd8

Please sign in to comment.