| 737 | runtime::VoiceTaskKind PocketTTSSession::task_kind() const { |
| 738 | return task_.task; |
| 739 | } |
| 740 | |
| 741 | runtime::RunMode PocketTTSSession::run_mode() const { |
| 742 | return task_.mode; |
| 743 | } |
| 744 | |
| 745 | void PocketTTSSession::prepare(const runtime::SessionPreparationRequest & request) { |
| 746 | prepared_session_request_ = |
| 747 | build_preparation_generation_request(request, manifest_->model_config.default_temperature); |
| 748 | if (!has_voice_selection(prepared_session_request_.voice)) { |
| 749 | throw std::runtime_error( |
| 750 | "PocketTTS session prepare() requires a session voice via --voice-id or --voice-ref"); |
| 751 | } |
| 752 | if (const auto export_path = runtime::find_option( |
| 753 | request.options, |
| 754 | {"pocket_tts.export_voice_state_path", "export_voice_state_path"})) { |
| 755 | export_voice_state(prepared_session_request_.voice, *export_path); |
no test coverage detected