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

Method AceStepDitWeightsRuntime

src/models/ace_step/dit_weights_runtime.cpp:293–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291} // namespace
292
293AceStepDitWeightsRuntime::AceStepDitWeightsRuntime(
294 std::shared_ptr<const AceStepAssets> assets,
295 core::ExecutionContext & execution,
296 assets::TensorStorageType storage_type,
297 size_t weight_context_bytes)
298 : assets_(std::move(assets)) {
299 if (!assets_) {
300 throw std::runtime_error("ACE-Step DiT weights runtime requires assets");
301 }
302 if (execution.backend() == nullptr) {
303 throw std::runtime_error("ACE-Step DiT weights runtime backend is not initialized");
304 }
305 store_ = std::make_shared<core::BackendWeightStore>(
306 execution.backend(),
307 execution.backend_type(),
308 "ace_step.dit.weights",
309 weight_context_bytes);
310 detokenizer_weights_ = load_detokenizer_weights(store_, *assets_, storage_type);
311 condition_encoder_weights_ = load_condition_encoder_weights(store_, *assets_, storage_type);
312 diffusion_weights_ = load_diffusion_weights(store_, *assets_, storage_type);
313 store_->upload();
314 assets_->dit_weights->release_storage();
315}
316
317const std::shared_ptr<const AceStepAssets> & AceStepDitWeightsRuntime::assets() const noexcept {
318 return assets_;

Callers

nothing calls this directly

Calls 7

load_detokenizer_weightsFunction · 0.85
load_diffusion_weightsFunction · 0.85
uploadMethod · 0.80
backendMethod · 0.45
backend_typeMethod · 0.45
release_storageMethod · 0.45

Tested by

no test coverage detected