| 99 | std::unique_ptr<runtime::IVoiceTaskSession> Qwen3ASRLoadedModel::create_task_session( |
| 100 | const runtime::TaskSpec & task, |
| 101 | const runtime::SessionOptions & options) const { |
| 102 | if (task.task != runtime::VoiceTaskKind::Asr) { |
| 103 | throw std::runtime_error("Qwen3 ASR only supports the Asr task"); |
| 104 | } |
| 105 | if (task.mode != runtime::RunMode::Offline && task.mode != runtime::RunMode::Streaming) { |
| 106 | throw std::runtime_error("Qwen3 ASR supports offline and streaming sessions"); |
| 107 | } |
| 108 | return std::make_unique<Qwen3ASRSession>(task, options, assets_); |
| 109 | } |
| 110 | |
| 111 | std::unique_ptr<Qwen3ASRLoadedModel> load_qwen3_asr_model(const std::filesystem::path & model_path) { |
| 112 | auto assets = load_qwen3_asr_assets(model_path); |
| 113 | return std::make_unique<Qwen3ASRLoadedModel>( |
| 114 | metadata(*assets), |