Skip to content

Commit 7cf1ae4

Browse files
committed
llama : remove unicode.h from llama-model.cpp
ggml-ci
1 parent c1d6ae9 commit 7cf1ae4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/llama-model.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
#include "ggml-cpp.h"
88

9-
#include "unicode.h" // TODO: remove
10-
119
#include <algorithm>
1210
#include <cassert>
1311
#include <cstring>
@@ -1282,6 +1280,7 @@ void llama_model::load_vocab(llama_model_loader & ml) {
12821280
vocab.n_vocab = 0;
12831281
LLAMA_LOG_WARN("%s: there is no vocab_size in metadata, vocab.n_vocab will be set to %u\n", __func__, vocab.n_vocab);
12841282
}
1283+
12851284
return;
12861285
}
12871286

@@ -1319,7 +1318,7 @@ void llama_model::load_vocab(llama_model_loader & ml) {
13191318
const int n_merges = gguf_get_arr_n(ctx, merges_keyidx);
13201319
for (int i = 0; i < n_merges; i++) {
13211320
const std::string word = gguf_get_arr_str(ctx, merges_keyidx, i);
1322-
GGML_ASSERT(unicode_cpts_from_utf8(word).size() > 0);
1321+
//GGML_ASSERT(unicode_cpts_from_utf8(word).size() > 0);
13231322

13241323
std::string first;
13251324
std::string second;
@@ -1913,8 +1912,8 @@ void llama_model::load_vocab(llama_model_loader & ml) {
19131912
//NOTE: Per token attributes are missing from the GGUF file.
19141913
//TODO: Extract attributes from GGUF file.
19151914
{
1916-
auto _contains_any = [] (const std::string &str, const std::vector<std::string> &substrs) -> bool {
1917-
for (auto substr : substrs) {
1915+
auto _contains_any = [] (const std::string & str, const std::vector<std::string> & substrs) -> bool {
1916+
for (const auto & substr : substrs) {
19181917
if (str.find(substr) < std::string::npos) {
19191918
return true;
19201919
}

0 commit comments

Comments
 (0)