#pragma once #include "engine/framework/core/execution_context.h" #include "engine/framework/assets/tensor_source.h" #include "engine/framework/io/json.h" #include #include #include #include #include namespace engine::conditioners { class MusicCoCaRuntime { public: MusicCoCaRuntime(core::ExecutionContext & execution, std::shared_ptr weights, io::json::Value graphs, const std::filesystem::path & tokenizer); ~MusicCoCaRuntime(); std::vector embed_text(const std::string & text); std::vector map_text(const std::vector & embedding, const std::vector & noise); std::vector map_text(const std::vector & embedding, uint32_t seed = 0); std::vector embed_features(const std::vector & log_mel); std::vector preprocess_audio(const std::vector & mono_16khz); std::vector embed_audio(const std::vector & mono_16khz); std::array quantize(const std::vector & embedding); private: class Impl; std::unique_ptr impl_; }; } // namespace engine::conditioners