8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9151e6 commit 3730134Copy full SHA for 3730134
llama.cpp
@@ -3366,9 +3366,15 @@ struct llm_tokenizer_bpe {
3366
std::string byte_str(1, *j);
3367
auto token_multibyte = vocab.token_to_id.find(byte_str);
3368
if (token_multibyte == vocab.token_to_id.end()) {
3369
- fprintf(stderr,"ERROR: byte not found in vocab: '%s'\n", byte_str.c_str());
+ try {
3370
+ llama_token token_byte = llama_byte_to_token(vocab, *j);
3371
+ output.push_back(token_byte);
3372
+ } catch (const std::out_of_range & err) {
3373
+ fprintf(stderr,"ERROR: byte not found in vocab: '%s'\n", byte_str.c_str());
3374
+ }
3375
+ } else {
3376
+ output.push_back((*token_multibyte).second);
3377
}
- output.push_back((*token_multibyte).second);
3378
3379
} else {
3380
output.push_back((*token).second);
0 commit comments