| 100 | inspection.discovered_configs = runtime::discover_named_assets_from_package_spec( |
| 101 | request.model_path, |
| 102 | package_spec, |
| 103 | engine::model_spec::ResourceKind::Files); |
| 104 | inspection.discovered_weights = runtime::discover_named_assets_from_package_spec( |
| 105 | request.model_path, |
| 106 | package_spec, |
| 107 | engine::model_spec::ResourceKind::Tensors); |
| 108 | return inspection; |
| 109 | } |
| 110 | |
| 111 | std::unique_ptr<runtime::ILoadedVoiceModel> load(const runtime::ModelLoadRequest & request) const override { |
| 112 | return load_stable_audio_model(request.model_path); |
| 113 | } |
| 114 | }; |
| 115 | |
| 116 | } // namespace |
| 117 | |
| 118 | StableAudioLoadedModel::StableAudioLoadedModel( |
| 119 | runtime::ModelMetadata metadata, |
| 120 | runtime::CapabilitySet capabilities, |
| 121 | std::shared_ptr<const StableAudioAssets> assets) |
| 122 | : metadata_(std::move(metadata)), |
| 123 | capabilities_(std::move(capabilities)), |
| 124 | assets_(std::move(assets)) {} |
| 125 | |
| 126 | const runtime::ModelMetadata & StableAudioLoadedModel::metadata() const noexcept { |
| 127 | return metadata_; |
| 128 | } |
| 129 | |
| 130 | const runtime::CapabilitySet & StableAudioLoadedModel::capabilities() const noexcept { |
| 131 | return capabilities_; |
| 132 | } |
| 133 | |
| 134 | std::unique_ptr<runtime::IVoiceTaskSession> StableAudioLoadedModel::create_task_session( |
| 135 | const runtime::TaskSpec & task, |
| 136 | const runtime::SessionOptions & options) const { |
| 137 | if (task.mode != runtime::RunMode::Offline) { |
| 138 | throw std::runtime_error("Stable Audio only supports offline sessions"); |
| 139 | } |
| 140 | if (task.task != runtime::VoiceTaskKind::AudioGeneration) { |
nothing calls this directly
no test coverage detected