Server: refactor and rename functions (#1151)

* Server: rename functions and refactor code

rename functions

refactor update slots

rename params_base

rename timings

* change

* Revert kv cache name changes

* Revert 2

* fix test build error

---------

Co-authored-by: firecoperana <firecoperana>
This commit is contained in:
firecoperana
2026-01-18 00:16:57 -06:00
committed by GitHub
parent 7024fdbc72
commit d71a3ec315
38 changed files with 532 additions and 528 deletions

View File

@@ -1576,7 +1576,7 @@ struct llama_vocab::impl {
std::vector<token_data> id_to_token;
std::vector<llama_token> cache_special_tokens;
std::vector<std::string> cache_token_to_piece; // llama_token_to_piece(special = true);
std::vector<std::string> cache_token_to_piece; // common_token_to_piece(special = true);
struct pair_hash {
size_t operator()(const std::pair<std::string, std::string> & p) const {
return std::hash<std::string>{}(p.first) ^ //create some hash for pair
@@ -3639,7 +3639,7 @@ int32_t llama_vocab_token_to_piece(
return vocab->token_to_piece(token, buf, length, lstrip, special);
}
//int32_t llama_detokenize(
//int32_t common_token_to_piece(
// const struct llama_vocab * vocab,
// const llama_token * tokens,
// int32_t n_tokens,

View File

@@ -802,7 +802,7 @@ std::vector<uint32_t> unicode_cpts_from_utf8(const std::string & utf8) {
result.push_back(unicode_cpt_from_utf8(utf8, offset));
}
catch (const std::invalid_argument & /*ex*/) {
// Silently ignore invalid UTF-8 input to avoid leaking the exception beyond llama_tokenize
// Silently ignore invalid UTF-8 input to avoid leaking the exception beyond common_tokenize
++offset;
result.emplace_back(0xFFFD); // replacement character
}