MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / llama_detokenize_bpe

Function llama_detokenize_bpe

common/common.cpp:1080–1092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078}
1079
1080std::string llama_detokenize_bpe(llama_context * ctx, const std::vector<llama_token> & tokens) {
1081 std::string piece;
1082 std::string result;
1083
1084 for (size_t i = 0; i < tokens.size(); ++i) {
1085 piece = llama_token_to_piece(ctx, tokens[i]);
1086
1087 result += piece;
1088 }
1089
1090 // NOTE: the original tokenizer decodes bytes after collecting the pieces.
1091 return result;
1092}
1093
1094//
1095// YAML utils

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 2

llama_token_to_pieceFunction · 0.70
sizeMethod · 0.45

Tested by 2

mainFunction · 0.68
mainFunction · 0.68