File tree 1 file changed +2
-2
lines changed
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) {
906
906
907
907
while (llama.has_next_token ) {
908
908
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 );
910
910
911
911
stop_pos = llama.findStoppingStrings (llama.generated_text ,
912
912
token_text.size (), STOP_FULL);
@@ -933,7 +933,7 @@ int main(int argc, char ** argv) {
933
933
934
934
while (llama.has_next_token ) {
935
935
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 );
937
937
if (llama.multibyte_pending > 0 ) {
938
938
continue ;
939
939
}
You can’t perform that action at this time.
0 commit comments