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

Method encode

src/models/vevo2/components.cpp:1139–1183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1137 return prosody_tokens;
1138 }
1139
1140 const int64_t style_frames = vevo2_frame_count_24k(*style_ref_audio);
1141 auto style_tokens = encode_chromagram_features(
1142 compute_vevo2_chromagram(
1143 *style_ref_audio,
1144 style_frames,
1145 1.0,
1146 generation.use_pitch_shift,
1147 generation.use_pitch_shift ? generation.style_shift_steps : 0),
1148 style_frames);
1149 style_tokens.ids.insert(style_tokens.ids.end(), prosody_tokens.ids.begin(), prosody_tokens.ids.end());
1150 return style_tokens;
1151}
1152
1153Vevo2CocoContentStyleTokenizerRuntime::Vevo2CocoContentStyleTokenizerRuntime(
1154 const Vevo2Assets & assets,
1155 engine::core::ExecutionContext & execution_context,
1156 size_t weight_context_bytes,
1157 size_t graph_context_bytes,
1158 engine::assets::TensorStorageType matmul_weight_storage_type,
1159 engine::assets::TensorStorageType conv_weight_storage_type)
1160 : config_(assets.config.content_style_tokenizer),
1161 execution_context_(execution_context),
1162 graph_context_bytes_(graph_context_bytes),
1163 weight_source_(assets.content_style_tokenizer_weights),
1164 weights_(load_coco_tokenizer_weights(
1165 config_,
1166 "content_style_tokenizer",
1167 execution_context.backend(),
1168 execution_context.backend_type(),
1169 weight_context_bytes,
1170 matmul_weight_storage_type,
1171 conv_weight_storage_type,
1172 *weight_source_)),
1173 name_("content_style_tokenizer") {
1174 if (config_.use_normed_whisper) {
1175 auto stats = load_whisper_stats(*assets.fm_whisper_stats, config_.whisper_dim);
1176 whisper_mean_ = std::move(stats.first);
1177 whisper_std_ = std::move(stats.second);
1178 }
1179 weight_source_->release_storage();
1180}
1181
1182Vevo2CocoContentStyleTokenizerRuntime::~Vevo2CocoContentStyleTokenizerRuntime() = default;
1183
1184Vevo2CocoTokenizerGraph & Vevo2CocoContentStyleTokenizerRuntime::ensure_graph(
1185 int64_t feature_frames,
1186 bool uses_whisper) const {

Callers 2

tokenize_promptMethod · 0.45
runMethod · 0.45

Calls 6

vevo2_frame_count_24kFunction · 0.85
compute_vevo2_chromagramFunction · 0.85
sizeMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected