MCPcopy Create free account
hub / github.com/andrewkchan/deepseek.cpp / encoding_to_debug_string

Method encoding_to_debug_string

src/tokenizer.cpp:96–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96std::string Tokenizer::encoding_to_debug_string(const std::vector<int>& encoding) const {
97 std::string token_encoding_debug_str = "";
98 for (int token_id : encoding) {
99 if (token_id == bos_id) {
100 token_encoding_debug_str += "[<s>:" + std::to_string(token_id) + "]";
101 } else if (token_id == eos_id) {
102 token_encoding_debug_str += "[</s>:" + std::to_string(token_id) + "]";
103 } else {
104 token_encoding_debug_str += "[" + vocab[token_id] + ":" + std::to_string(token_id) + "]";
105 }
106 }
107 return token_encoding_debug_str;
108}

Callers 1

encode_promptFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected