| 209 | } |
| 210 | |
| 211 | AceStepDiTAttentionWeights 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 | |
| 228 | std::shared_ptr<const AceStepDiffusionWeights> load_diffusion_weights( |
| 229 | const std::shared_ptr<core::BackendWeightStore> & store, |
no test coverage detected