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

Function load_dit_attention_weights

src/models/ace_step/dit_weights_runtime.cpp:211–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211AceStepDiTAttentionWeights load_dit_attention_weights(
212 core::BackendWeightStore & store,
213 const assets::TensorSource & source,
214 const std::string & prefix,
215 assets::TensorStorageType storage_type,
216 const AceStepDiffusionConfig & config) {
217 const int64_t dim = ace_step_diffusion_attention_head_dim(config, "ACE-Step DiT");
218 return {
219 store.load_tensor(source, prefix + ".q_proj.weight", storage_type, {config.num_attention_heads * dim, config.hidden_size}),
220 store.load_tensor(source, prefix + ".k_proj.weight", storage_type, {config.num_key_value_heads * dim, config.hidden_size}),
221 store.load_tensor(source, prefix + ".v_proj.weight", storage_type, {config.num_key_value_heads * dim, config.hidden_size}),
222 store.load_tensor(source, prefix + ".o_proj.weight", storage_type, {config.hidden_size, config.num_attention_heads * dim}),
223 store.load_f32_tensor(source, prefix + ".q_norm.weight", {dim}),
224 store.load_f32_tensor(source, prefix + ".k_norm.weight", {dim}),
225 };
226}
227
228std::shared_ptr<const AceStepDiffusionWeights> load_diffusion_weights(
229 const std::shared_ptr<core::BackendWeightStore> & store,

Callers 1

load_diffusion_weightsFunction · 0.85

Calls 3

load_tensorMethod · 0.80
load_f32_tensorMethod · 0.80

Tested by

no test coverage detected