| 56 | {"chatterbox.multilingual_t3", "v2|v3", "Multilingual T3 checkpoint for non-English TTS; default v2.", false, "v2"}, |
| 57 | {"chatterbox.conditionals_cache_slots", "int", "Prepared voice-condition cache slots; default 1, set 0 to disable.", false, "1", "0"}, |
| 58 | {"chatterbox.vc_reference_cache_slots", "int", "Prepared voice-conversion target cache slots; default 1, set 0 to disable.", false, "1", "0"}, |
| 59 | {"chatterbox.mem_saver", "bool", "Free non-conditional runtime graphs after each request chunk; default false.", false, "false"}, |
| 60 | {"chatterbox.encoder_condition_samples", "int", "Maximum reference samples for the T3 tokenizer; the voice encoder still consumes the full 16 kHz reference. Default: 96000.", false, "96000"}, |
| 61 | {"chatterbox.decoder_condition_samples", "int", "S3Gen reference sample limit at 24 kHz.", false, "240000"}, |
| 62 | {"chatterbox.t3_speech_cond_prompt_len", "int", "T3 reference speech prompt token limit.", false, "150"}, |
| 63 | }; |
| 64 | return out; |
| 65 | } |
| 66 | |
| 67 | class ChatterboxLoader final : public runtime::IVoiceModelLoader { |
| 68 | public: |
| 69 | std::string family() const override { |
| 70 | return "chatterbox"; |
| 71 | } |
| 72 | |
| 73 | runtime::CapabilitySet advertised_capabilities() const override { |
| 74 | runtime::CapabilitySet out; |
| 75 | out.supported_tasks.push_back({runtime::VoiceTaskKind::Tts, {runtime::RunMode::Offline}}); |
| 76 | out.supported_tasks.push_back({runtime::VoiceTaskKind::VoiceCloning, {runtime::RunMode::Offline}}); |
| 77 | out.supported_tasks.push_back({runtime::VoiceTaskKind::VoiceConversion, {runtime::RunMode::Offline}}); |
| 78 | out.languages = supported_chatterbox_language_codes(); |
| 79 | out.supports_speaker_reference = true; |
| 80 | out.supports_style_condition = true; |
| 81 | return out; |
| 82 | } |
| 83 | |
| 84 | bool can_load(const runtime::ModelLoadRequest & request) const override { |
| 85 | try { |
| 86 | (void) engine::model_spec::load_resource_bundle( |
| 87 | request.model_path, |
| 88 | engine::model_spec::default_spec_path(family())); |
| 89 | return !request.family_hint.has_value() || *request.family_hint == family(); |
| 90 | } catch (...) { |
| 91 | return false; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | runtime::ModelInspection inspect(const runtime::ModelLoadRequest & request) const override { |
| 96 | const auto assets = load_chatterbox_assets(request.model_path); |
| 97 | runtime::ModelInspection inspection; |
| 98 | inspection.model_root = assets->resources.model_root(); |
| 99 | inspection.metadata = metadata(*assets); |
| 100 | inspection.capabilities = capabilities(*assets); |
| 101 | inspection.cli = cli(*assets); |
| 102 | const auto spec_path = engine::model_spec::default_spec_path(family()); |
nothing calls this directly
no test coverage detected