llama : support NUL bytes in tokens
This commit is contained in:
parent
4134999e01
commit
faaac59d16
7 changed files with 28 additions and 18 deletions
|
@ -561,7 +561,7 @@ static void load_vocab(const char * filename, const Config * config, struct llam
|
|||
vocab->id_to_token.resize(n_vocab);
|
||||
|
||||
for (uint32_t i = 0; i < n_vocab; i++) {
|
||||
std::string word = gguf_get_arr_str(ctx, token_idx, i);
|
||||
std::string word(gguf_get_arr_str(ctx, token_idx, i), gguf_get_arr_str_n(ctx, token_idx, i));
|
||||
|
||||
vocab->token_to_id[word] = i;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue