| 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 | |
| 266 | VoiceEncoderComponent 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 | |
| 272 | VoiceEncoderComponent::VoiceEncoderComponent( |
| 273 | std::shared_ptr<const VoiceEncoderWeights> weights, |
| 274 | engine::core::BackendConfig backend) |
| 275 | : weights_(std::move(weights)), |
no test coverage detected