#pragma once #include "engine/framework/assets/resource_bundle.h" #include "engine/framework/assets/tensor_source.h" #include #include #include #include namespace engine::models::sherpa_kws { struct SherpaKwsConfig { std::string family = "sherpa_kws"; std::string model_type = "zipformer2"; std::string variant = "sherpa-onnx-streaming-kws"; std::string language = "auto"; int64_t sample_rate = 16000; int64_t feature_dim = 80; int64_t chunk_size = 269; int64_t chunk_shift = 256; int64_t subsampling_factor = 4; int64_t vocab_size = 0; int64_t context_size = 2; int64_t blank_id = 0; int64_t unk_id = 2; int64_t decoder_dim = 512; std::vector encoder_dims; std::vector query_head_dims; std::vector value_head_dims; std::vector num_heads; std::vector num_encoder_layers; std::vector cnn_module_kernels; std::vector left_context_len; std::vector downsampling_factors; }; struct SherpaKwsAssets { SherpaKwsConfig config; assets::ResourceBundle resources; std::shared_ptr weights; std::vector tokens; }; std::shared_ptr load_sherpa_kws_assets( const std::filesystem::path & model_path); } // namespace engine::models::sherpa_kws