MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / load_chatterbox_model

Function load_chatterbox_model

src/models/chatterbox/loader.cpp:141–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141std::unique_ptr<runtime::IVoiceTaskSession> ChatterboxLoadedModel::create_task_session(
142 const runtime::TaskSpec & task,
143 const runtime::SessionOptions & options) const {
144 if (task.task != runtime::VoiceTaskKind::Tts &&
145 task.task != runtime::VoiceTaskKind::VoiceCloning &&
146 task.task != runtime::VoiceTaskKind::VoiceConversion) {
147 throw std::runtime_error("Chatterbox supports TTS, voice cloning, and voice conversion");
148 }
149 if (task.mode != runtime::RunMode::Offline) {
150 throw std::runtime_error("Chatterbox only supports offline mode");
151 }
152 return std::make_unique<ChatterboxSession>(task, options, assets_);
153}
154
155std::unique_ptr<ChatterboxLoadedModel> load_chatterbox_model(const std::filesystem::path & model_root) {
156 auto assets = load_chatterbox_assets(model_root);
157
158 return std::make_unique<ChatterboxLoadedModel>(
159 metadata(*assets),
160 capabilities(*assets),
161 std::move(assets));
162}
163
164std::shared_ptr<runtime::IVoiceModelLoader> make_chatterbox_loader() {
165 return std::make_shared<ChatterboxLoader>();
166}
167
168} // namespace engine::models::chatterbox

Callers 1

loadMethod · 0.85

Calls 3

resolve_model_rootFunction · 0.70

Tested by

no test coverage detected