| 181 | } |
| 182 | |
| 183 | void server_models::add_model(server_model_meta && meta) { |
| 184 | if (mapping.find(meta.name) != mapping.end()) { |
| 185 | throw std::runtime_error(string_format("model '%s' appears multiple times", meta.name.c_str())); |
| 186 | } |
| 187 | meta.update_args(ctx_preset, bin_path); // render args |
| 188 | std::string name = meta.name; |
| 189 | mapping[name] = instance_t{ |
| 190 | /* subproc */ std::make_shared<subprocess_s>(), |
| 191 | /* th */ std::thread(), |
| 192 | /* meta */ std::move(meta) |
| 193 | }; |
| 194 | } |
| 195 | |
| 196 | // TODO: allow refreshing cached model list |
| 197 | void server_models::load_models() { |
nothing calls this directly
no test coverage detected