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

Function load_decoder_block

src/models/stable_audio/same_autoencoder.cpp:443–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441 prefix + ".mapping",
442 storage_type,
443 out_channels,
444 in_channels,
445 kernel,
446 true);
447 weights.new_tokens = store.load_f32_tensor(source, prefix + ".new_tokens", {1, 1, in_channels});
448 const int64_t depth = config.same_decoder_transformer_depths.back();
449 weights.transformers.reserve(static_cast<size_t>(depth));
450 for (int64_t layer = 0; layer < depth; ++layer) {
451 weights.transformers.push_back(load_same_transformer(
452 store,
453 source,
454 prefix + ".transformers." + std::to_string(layer),
455 config,
456 in_channels,
457 storage_type));
458 }
459 return weights;
460}
461
462StableAudioSameResamplingBlockWeights load_encoder_block(
463 core::BackendWeightStore & store,
464 const assets::TensorSource & source,
465 const StableAudioConfig & config,
466 assets::TensorStorageType storage_type) {
467 const int64_t block_index = 0;
468 const int64_t in_channels = config.same_encoder_in_channels;
469 const int64_t out_channels = config.same_channels * config.same_c_mults.front();
470 const int64_t kernel = config.same_encoder_conv_mapping ? 3 : 1;
471 const std::string prefix = "pretransform.model.encoder.layers." + std::to_string(block_index);
472 StableAudioSameResamplingBlockWeights weights;
473 weights.mapping = load_weight_norm_conv1d(
474 store,
475 source,
476 prefix + ".mapping",
477 storage_type,
478 out_channels,
479 in_channels,

Callers 1

Calls 4

load_same_transformerFunction · 0.85
load_f32_tensorMethod · 0.80
load_weight_norm_conv1dFunction · 0.70
to_stringFunction · 0.50

Tested by

no test coverage detected