| 1980 | } |
| 1981 | |
| 1982 | size_t server_prompt_cache::n_tokens() const { |
| 1983 | size_t res = 0; |
| 1984 | |
| 1985 | for (const auto & state : states) { |
| 1986 | res += state.n_tokens(); |
| 1987 | } |
| 1988 | |
| 1989 | return res; |
| 1990 | } |
| 1991 | |
| 1992 | server_prompt * server_prompt_cache::alloc(const server_prompt & prompt, size_t state_size) { |
| 1993 | // first check if the current state is contained fully in the cache |
no outgoing calls
no test coverage detected