diff --git a/llama.cpp b/llama.cpp index 1be101ca2..27f1478ea 100644 --- a/llama.cpp +++ b/llama.cpp @@ -4205,7 +4205,7 @@ int llama_token_to_str_bpe(const struct llama_context * ctx, llama_token token, if (0 <= token && token < llama_n_vocab_from_model(&ctx->model)) { std::string result = ctx->model.vocab.id_to_token[token].tok; if (result.length() > length) { - return -result.length(); + return - result.length(); } strcpy(str, result.c_str()); return result.length(); diff --git a/llama.h b/llama.h index 2f2ea037a..435ce7ba7 100644 --- a/llama.h +++ b/llama.h @@ -476,11 +476,11 @@ extern "C" { #include #include -static std::string llama_token_to_str( +std::string llama_token_to_str( const struct llama_context * ctx, llama_token token); -static std::string llama_token_to_str_bpe( +std::string llama_token_to_str_bpe( const struct llama_context * ctx, llama_token token);