| 215 | |
| 216 | const runtime::CapabilitySet & SileroVADLoadedModel::capabilities() const noexcept { |
| 217 | return capabilities_; |
| 218 | } |
| 219 | |
| 220 | std::unique_ptr<runtime::IVoiceTaskSession> SileroVADLoadedModel::create_task_session( |
| 221 | const runtime::TaskSpec & task, |
| 222 | const runtime::SessionOptions & options) const { |
| 223 | return std::make_unique<SileroVADSession>(task, options, weights_); |
| 224 | } |
| 225 | |
| 226 | std::unique_ptr<SileroVADLoadedModel> load_silero_vad_model(const runtime::ModelLoadRequest & request) { |
| 227 | if (request.config_id.has_value()) { |
| 228 | throw std::runtime_error("Silero VAD does not expose selectable config assets"); |
| 229 | } |
| 230 | const auto weights = discover_weight_assets(request); |
| 231 | const auto * selected_weight = runtime::select_named_asset(weights, request.weight_id, "weight"); |
| 232 | const auto weight_path = selected_weight != nullptr ? selected_weight->path : resolve_weight_path(request.model_path); |
| 233 | const auto assets = resolve_silero_assets(weight_path); |
| 234 | runtime::ModelMetadata metadata; |
| 235 | metadata.family = "silero_vad"; |
| 236 | metadata.variant = "16k"; |
| 237 | metadata.description = "Silero VAD loaded from safetensors weights."; |
| 238 | metadata.weight_candidates = {"silero_vad_16k.safetensors"}; |
| 239 | runtime::CapabilitySet capabilities; |
| 240 | capabilities.supported_tasks = { |
| 241 | {runtime::VoiceTaskKind::Vad, {runtime::RunMode::Offline, runtime::RunMode::Streaming}}, |
| 242 | }; |
no test coverage detected