File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -906,7 +906,7 @@ int main(int argc, char ** argv) {
906906
907907 while (llama.has_next_token ) {
908908 const completion_token_output token_with_probs = llama.doCompletion ();
909- const std::string token_text = llama_token_to_str (llama.ctx , token_with_probs.tok );
909+ const std::string token_text = token_with_probs. tok == - 1 ? " " : llama_token_to_str (llama.ctx , token_with_probs.tok );
910910
911911 stop_pos = llama.findStoppingStrings (llama.generated_text ,
912912 token_text.size (), STOP_FULL);
@@ -933,7 +933,7 @@ int main(int argc, char ** argv) {
933933
934934 while (llama.has_next_token ) {
935935 const completion_token_output token_with_probs = llama.doCompletion ();
936- const std::string token_text = llama_token_to_str (llama.ctx , token_with_probs.tok );
936+ const std::string token_text = token_with_probs. tok == - 1 ? " " : llama_token_to_str (llama.ctx , token_with_probs.tok );
937937 if (llama.multibyte_pending > 0 ) {
938938 continue ;
939939 }
You can’t perform that action at this time.
0 commit comments