MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / detokenize

Method detokenize

subprojects/llama.cpp/tools/server/server-common.cpp:371–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371std::string server_tokens::detokenize(const llama_context * ctx, bool special) const {
372 llama_tokens text_tokens;
373 text_tokens.reserve(tokens.size());
374 for (const auto & t : tokens) {
375 if (t != LLAMA_TOKEN_NULL) {
376 text_tokens.push_back(t);
377 }
378 }
379 return common_detokenize(ctx, text_tokens, special);
380}
381
382size_t server_tokens::get_common_prefix(const server_tokens & b) const {
383 const size_t max_idx = std::min(tokens.size(), b.tokens.size());

Callers 2

to_jsonMethod · 0.45
send_final_responseMethod · 0.45

Calls 3

common_detokenizeFunction · 0.85
sizeMethod · 0.65
push_backMethod · 0.45

Tested by

no test coverage detected