| 127 | const auto * loader = find_loader(request); |
| 128 | if (loader == nullptr) { |
| 129 | throw std::runtime_error("no registered model loader can load: " + request.model_path.string()); |
| 130 | } |
| 131 | const auto inspection = engine::debug::trace_log_enabled() |
| 132 | ? std::optional<ModelInspection>(loader->inspect(request)) |
| 133 | : std::nullopt; |
| 134 | auto model = loader->load(request); |
| 135 | if (inspection.has_value()) { |
| 136 | log_model_load_trace(*inspection, *model); |
| 137 | } |
| 138 | return model; |
| 139 | } |
| 140 | |
| 141 | std::unique_ptr<ILoadedVoiceModel> ModelRegistry::load(const std::filesystem::path & model_path) const { |
| 142 | ModelLoadRequest request; |
| 143 | request.model_path = model_path; |
| 144 | return load(request); |
| 145 | } |
| 146 |
no test coverage detected