| 1853 | } |
| 1854 | |
| 1855 | size_t server_prompt_cache::n_tokens() const { |
| 1856 | size_t res = 0; |
| 1857 | |
| 1858 | for (const auto & state : states) { |
| 1859 | res += state.n_tokens(); |
| 1860 | } |
| 1861 | |
| 1862 | return res; |
| 1863 | } |
| 1864 | |
| 1865 | server_prompt * server_prompt_cache::alloc(const server_prompt & prompt, size_t state_size) { |
| 1866 | // first check if the current state is contained fully in the cache |
no outgoing calls
no test coverage detected