Skip to content

Commit 2f3dbff

Browse files
authored
common : fix incorrect print of non-ascii characters in the logging (ggml-org#15466)
Signed-off-by: Jie Fu <[email protected]>
1 parent 945e1f1 commit 2f3dbff

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

common/common.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -558,13 +558,6 @@ std::string string_from(const struct llama_context * ctx, const std::vector<llam
558558

559559
auto detokenized = common_token_to_piece(ctx, token);
560560

561-
detokenized.erase(
562-
std::remove_if(
563-
detokenized.begin(),
564-
detokenized.end(),
565-
[](const unsigned char c) { return !std::isprint(c); }),
566-
detokenized.end());
567-
568561
buf << "'" << detokenized << "'"
569562
<< ":" << std::to_string(token);
570563
}
@@ -589,13 +582,6 @@ std::string string_from(const struct llama_context * ctx, const struct llama_bat
589582

590583
auto detokenized = common_token_to_piece(ctx, batch.token[i]);
591584

592-
detokenized.erase(
593-
std::remove_if(
594-
detokenized.begin(),
595-
detokenized.end(),
596-
[](const unsigned char c) { return !std::isprint(c); }),
597-
detokenized.end());
598-
599585
buf << "\n" << std::to_string(i)
600586
<< ", token '" << detokenized << "'"
601587
<< ", pos " << std::to_string(batch.pos[i])

0 commit comments

Comments
 (0)