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

Function require_head_dim

src/models/vibevoice/decoder.cpp:47–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45};
46
47int64_t require_head_dim(const VibeVoiceDecoderConfig & config) {
48 if (config.hidden_size <= 0 || config.intermediate_size <= 0) {
49 throw std::runtime_error("VibeVoice decoder hidden sizes must be positive");
50 }
51 if (config.num_attention_heads <= 0 || config.num_key_value_heads <= 0 || config.head_dim <= 0) {
52 throw std::runtime_error("VibeVoice decoder attention dimensions must be positive");
53 }
54 if (config.num_attention_heads % config.num_key_value_heads != 0) {
55 throw std::runtime_error("VibeVoice decoder attention heads must be divisible by key/value heads");
56 }
57 if (config.num_attention_heads * config.head_dim != config.hidden_size) {
58 throw std::runtime_error("VibeVoice decoder hidden_size must equal attention heads times head_dim");
59 }
60 return config.head_dim;
61}
62
63core::TensorValue reshape_heads(
64 core::ModuleBuildContext & ctx,

Calls

no outgoing calls

Tested by

no test coverage detected