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

Function project_embedding

src/models/chatterbox/voice_encoder_impl.cpp:253–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251 weights->lstm_layers[1].weight_ih = source.require_f32("lstm.weight_ih_l1", {1024, 256});
252 weights->lstm_layers[1].weight_hh = source.require_f32("lstm.weight_hh_l1", {1024, 256});
253 weights->lstm_layers[1].bias_ih = source.require_f32("lstm.bias_ih_l1", {1024});
254 weights->lstm_layers[1].bias_hh = source.require_f32("lstm.bias_hh_l1", {1024});
255 weights->lstm_layers[2].weight_ih = source.require_f32("lstm.weight_ih_l2", {1024, 256});
256 weights->lstm_layers[2].weight_hh = source.require_f32("lstm.weight_hh_l2", {1024, 256});
257 weights->lstm_layers[2].bias_ih = source.require_f32("lstm.bias_ih_l2", {1024});
258 weights->lstm_layers[2].bias_hh = source.require_f32("lstm.bias_hh_l2", {1024});
259 weights->proj_weight = source.require_f32("proj.weight", {256, 256});
260 weights->proj_bias = source.require_f32("proj.bias", {256});
261 weights->similarity_weight = source.require_f32("similarity_weight", {1});
262 weights->similarity_bias = source.require_f32("similarity_bias", {1});
263 return weights;
264}
265
266VoiceEncoderComponent VoiceEncoderComponent::load_from_source(
267 const engine::assets::TensorSource & source,
268 engine::core::BackendConfig backend) {
269 return VoiceEncoderComponent(load_voice_encoder_weights(source), backend);
270}
271
272VoiceEncoderComponent::VoiceEncoderComponent(
273 std::shared_ptr<const VoiceEncoderWeights> weights,
274 engine::core::BackendConfig backend)
275 : weights_(std::move(weights)),

Callers 1

Calls 2

l2_normalizeFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected