Skip to content

Commit 9a79f93

Browse files
committed
fix: llama-3 ignore_merges
1 parent d11afd6 commit 9a79f93

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

llama.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12292,6 +12292,20 @@ struct llm_tokenizer_bpe {
1229212292
symbols_final.clear();
1229312293

1229412294
for (auto & word : word_collection) {
12295+
if (vocab.token_to_id.find(word) != vocab.token_to_id.end()) {
12296+
llm_symbol sym;
12297+
sym.text = word.c_str();
12298+
sym.n = word.size();
12299+
sym.prev = final_prev_index;
12300+
sym.next = -1;
12301+
if (final_prev_index != -1) {
12302+
symbols_final[final_prev_index].next = symbols_final.size();
12303+
}
12304+
symbols_final.emplace_back(sym);
12305+
final_prev_index = symbols_final.size() - 1;
12306+
continue;
12307+
}
12308+
1229512309
work_queue = llm_bigram_bpe::queue();
1229612310
symbols.clear();
1229712311

0 commit comments

Comments
 (0)