| 552 | } |
| 553 | |
| 554 | int64_t audio_frames_per_latent(const AceStepVAEConfig & config) { |
| 555 | if (config.downsampling_ratios.empty()) { |
| 556 | throw std::runtime_error("ACE-Step VAE requires downsampling ratios"); |
| 557 | } |
| 558 | int64_t factor = 1; |
| 559 | for (const int64_t ratio : config.downsampling_ratios) { |
| 560 | if (ratio <= 0) { |
| 561 | throw std::runtime_error("ACE-Step VAE downsampling ratio must be positive"); |
| 562 | } |
| 563 | factor *= ratio; |
| 564 | } |
| 565 | return factor; |
| 566 | } |
| 567 | |
| 568 | } // namespace vae_common |
| 569 |