| 186 | } // namespace |
| 187 | |
| 188 | FoundationSession::FoundationSession( |
| 189 | runtime::TaskSpec task, |
| 190 | runtime::SessionOptions options, |
| 191 | std::shared_ptr<const StableAudioAssets> assets) |
| 192 | : runtime::RuntimeSessionBase(options), |
| 193 | task_(task), |
| 194 | assets_(require_assets(std::move(assets))) { |
| 195 | max_batch_ = runtime::parse_int_option(options.options, {"stable_audio.max_batch"}).value_or(max_batch_); |
| 196 | if (max_batch_ <= 0) { |
| 197 | throw std::runtime_error("stable_audio.max_batch must be positive"); |
| 198 | } |
| 199 | if (const auto it = this->options().options.find("stable_audio.weight_type"); it != this->options().options.end()) { |
| 200 | weight_storage_type_ = engine::assets::parse_tensor_storage_type(it->second); |
| 201 | validate_weight_storage(weight_storage_type_, "stable_audio.weight_type"); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | FoundationSession::~FoundationSession() = default; |
| 206 |
nothing calls this directly
no test coverage detected