#pragma once #include "engine/models/seed_vc/assets.h" #include "engine/framework/assets/tensor_source.h" #include "engine/framework/core/backend.h" #include #include #include namespace engine::models::seed_vc { struct SeedVcV1CfmEstimatorInput { std::vector x; std::vector prompt; std::vector cond; std::vector style; std::vector timestep; int64_t batch = 0; int64_t frames = 0; }; struct SeedVcV1CfmEstimatorOutput { std::vector velocity; int64_t batch = 0; int64_t channels = 0; int64_t frames = 0; }; struct SeedVcV1CfmInferenceInput { std::vector mu; std::vector prompt; std::vector style; std::vector initial_noise; int64_t batch = 0; int64_t frames = 0; int64_t prompt_frames = 0; int num_inference_steps = 0; float temperature = 1.0F; float inference_cfg_rate = 0.5F; }; class SeedVcV1CfmEstimator { public: SeedVcV1CfmEstimator() = default; SeedVcV1CfmEstimator( std::shared_ptr source, engine::core::BackendConfig backend, engine::assets::TensorStorageType storage_type, SeedVcV1DitConfig config, SeedVcV1WavenetConfig wavenet_config, int64_t style_dim); ~SeedVcV1CfmEstimator(); SeedVcV1CfmEstimator(SeedVcV1CfmEstimator &&) noexcept; SeedVcV1CfmEstimator & operator=(SeedVcV1CfmEstimator &&) noexcept; SeedVcV1CfmEstimator(const SeedVcV1CfmEstimator &) = delete; SeedVcV1CfmEstimator & operator=(const SeedVcV1CfmEstimator &) = delete; SeedVcV1CfmEstimatorOutput run(const SeedVcV1CfmEstimatorInput & input) const; SeedVcV1CfmEstimatorOutput infer(const SeedVcV1CfmInferenceInput & input) const; private: struct State; SeedVcV1DitConfig config_; SeedVcV1WavenetConfig wavenet_config_; int64_t style_dim_ = 0; std::shared_ptr state_; }; } // namespace engine::models::seed_vc