Skip to content

Commit dcf1c3a

Browse files
authored
use find instead
1 parent b2b9bd8 commit dcf1c3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/llama.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5152,10 +5152,10 @@ static void llm_load_vocab(
51525152
if (gen_name.find("code") != std::string::npos) {
51535153
if (model.arch == LLM_ARCH_LLAMA
51545154
&& 32010 < vocab.id_to_token.size()
5155-
&& vocab.id_to_token[32007].text.ends_with("<PRE>")
5156-
&& vocab.id_to_token[32008].text.ends_with("<SUF>")
5157-
&& vocab.id_to_token[32009].text.ends_with("<MID>")
5158-
&& vocab.id_to_token[32010].text.ends_with("<EOT>")) {
5155+
&& vocab.id_to_token[32007].text.find("<PRE>") != std::string::npos
5156+
&& vocab.id_to_token[32008].text.find("<SUF>") != std::string::npos
5157+
&& vocab.id_to_token[32009].text.find("<MID>") != std::string::npos
5158+
&& vocab.id_to_token[32010].text.find("<EOT>") != std::string::npos) {
51595159
vocab.special_prefix_id = 32007;
51605160
vocab.special_suffix_id = 32008;
51615161
vocab.special_middle_id = 32009;

0 commit comments

Comments
 (0)