| 268 | assets::require_tensor_shape( |
| 269 | weights, |
| 270 | "model.semantic_tokenizer.encoder.downsample_layers.0.0.conv.conv.weight", |
| 271 | {config.semantic_tokenizer.encoder_n_filters, config.semantic_tokenizer.channels, 7}); |
| 272 | } |
| 273 | |
| 274 | float require_scalar_f32(const assets::TensorSource & source, const std::string & name) { |
| 275 | const auto tensor = source.require_tensor_data(name); |
| 276 | if (!tensor.metadata.shape.empty()) { |
| 277 | throw std::runtime_error("VibeVoice tensor must be scalar: " + name); |
| 278 | } |
| 279 | const auto storage_type = assets::tensor_storage_type_for_dtype(tensor.metadata.dtype); |
| 280 | float value = 0.0F; |
| 281 | switch (storage_type) { |
| 282 | case assets::TensorStorageType::F32: |
| 283 | if (tensor.bytes.size() != sizeof(float)) { |
no test coverage detected