mirror of
https://gitlab.com/niansa/libjustlm.git
synced 2025-03-06 20:49:17 +01:00
Convert tokens to text correctly in llama
This commit is contained in:
parent
907cea7f9d
commit
3a953ed13a
1 changed files with 2 additions and 1 deletions
|
@ -231,7 +231,8 @@ public:
|
|||
LM_COAWAIT window_scroll();
|
||||
|
||||
// Get token as string
|
||||
const std::string_view str = llama_token_get_text(state->ctx, id);
|
||||
std::string str(14, ' ');
|
||||
str.resize(llama_token_to_piece(state->ctx, id, str.data(), 14));
|
||||
|
||||
// Append string to function result
|
||||
state->prompt.append(str);
|
||||
|
|
Loading…
Add table
Reference in a new issue