| 10755 | } |
| 10756 | |
| 10757 | static 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 |
| 10768 | int llama_token_to_piece(const struct llama_model * model, llama_token token, char * buf, int length) { |
no test coverage detected