Skip to content

Commit f056319

Browse files
committed
llama : handle no-vocab detokenization
1 parent 6be275d commit f056319

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/llama-vocab.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,10 @@ int32_t llama_detokenize_impl(
18671867
int32_t text_len_max,
18681868
bool remove_special,
18691869
bool unparse_special) {
1870+
if (vocab.type == LLAMA_VOCAB_TYPE_NONE) {
1871+
return 0;
1872+
}
1873+
18701874
GGML_ASSERT(vocab.tokenizer && "Tokenizer not initialized. Call llama_vocab::init_tokenizer() first.");
18711875

18721876
int32_t avail = text_len_max;

0 commit comments

Comments
 (0)