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