auto detokenized = common_token_to_piece(ctx, token);
- detokenized.erase(
- std::remove_if(
- detokenized.begin(),
- detokenized.end(),
- [](const unsigned char c) { return !std::isprint(c); }),
- detokenized.end());
-
buf << "'" << detokenized << "'"
<< ":" << std::to_string(token);
}
auto detokenized = common_token_to_piece(ctx, batch.token[i]);
- detokenized.erase(
- std::remove_if(
- detokenized.begin(),
- detokenized.end(),
- [](const unsigned char c) { return !std::isprint(c); }),
- detokenized.end());
-
buf << "\n" << std::to_string(i)
<< ", token '" << detokenized << "'"
<< ", pos " << std::to_string(batch.pos[i])