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

Function llama_decode_text

llama.cpp:10757–10765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10755}
10756
10757static std::string llama_decode_text(const std::string & text) {
10758 std::string decoded_text;
10759 auto unicode_sequences = codepoints_from_utf8(text);
10760 for (auto& unicode_sequence : unicode_sequences) {
10761 decoded_text += unicode_to_bytes_bpe(codepoint_to_utf8(unicode_sequence));
10762 }
10763
10764 return decoded_text;
10765}
10766
10767// does not write null-terminator to buf
10768int llama_token_to_piece(const struct llama_model * model, llama_token token, char * buf, int length) {

Callers 1

llama_token_to_pieceFunction · 0.70

Calls 3

codepoints_from_utf8Function · 0.85
unicode_to_bytes_bpeFunction · 0.85
codepoint_to_utf8Function · 0.85

Tested by

no test coverage detected