| 294 | VibeVoiceQwen2Weights load_vibevoice_decoder_weights( |
| 295 | const VibeVoiceAssets & assets, |
| 296 | ggml_backend_t backend, |
| 297 | core::BackendType backend_type, |
| 298 | size_t weight_context_bytes, |
| 299 | assets::TensorStorageType weight_storage_type) { |
| 300 | if (assets.model_weights == nullptr) { |
| 301 | throw std::runtime_error("VibeVoice decoder requires model weights"); |
| 302 | } |
| 303 | const auto & config = assets.config.decoder; |
| 304 | require_head_dim(config); |
| 305 | VibeVoiceQwen2Weights weights; |
| 306 | weights.store = std::make_shared<core::BackendWeightStore>( |
| 307 | backend, |
| 308 | backend_type, |
| 309 | "vibevoice.decoder.weights", |
| 310 | weight_context_bytes); |
| 311 | const auto queue_started = std::chrono::steady_clock::now(); |
| 312 | weights.token_embedding = weights.store->load_tensor( |
| 313 | *assets.model_weights, |
| 314 | "model.language_model.embed_tokens.weight", |
| 315 | weight_storage_type, |
| 316 | {config.vocab_size, config.hidden_size}); |
| 317 | if (config.tie_word_embeddings) { |
| 318 | weights.lm_head = weights.token_embedding; |
| 319 | } else { |
no test coverage detected