MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / FoundationSession

Method FoundationSession

src/models/stable_audio/foundation/session.cpp:188–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186} // namespace
187
188FoundationSession::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
205FoundationSession::~FoundationSession() = default;
206

Callers

nothing calls this directly

Calls 6

parse_int_optionFunction · 0.85
require_assetsFunction · 0.70
validate_weight_storageFunction · 0.70
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected