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

Function common_tokens_to_str

subprojects/llama.cpp/common/ngram-map.cpp:23–34  ·  view source on GitHub ↗

Print the values of a sublist of `llama_tokens & inp` to a string in the form [v0, v1, v2, ...].

Source from the content-addressed store, hash-verified

21
22// Print the values of a sublist of `llama_tokens & inp` to a string in the form [v0, v1, v2, ...].
23static std::string common_tokens_to_str(const llama_tokens & inp, size_t start, size_t length) {
24 std::ostringstream oss;
25 oss << '[';
26 for (size_t i = 0; i < length; ++i) {
27 if (i > 0) {
28 oss << ", ";
29 }
30 oss << inp[start + i];
31 }
32 oss << ']';
33 return oss.str();
34}
35
36
37// n-gram simple

Callers 1

common_ngram_map_draftFunction · 0.85

Calls 1

strMethod · 0.45

Tested by

no test coverage detected