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

Function print_model_common_options

app/cli/main.cpp:177–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175 << " spk speaker embedding/recognition\n"
176 << " svc singing voice conversion\n"
177 << " midi audio-to-symbolic MIDI/event transcription\n";
178}
179
180void print_option_group(const char * title, const std::vector<engine::runtime::CliOptionInfo> & options) {
181 if (options.empty()) {
182 return;
183 }
184 std::cout << " " << title << ":\n";
185 for (const auto & option : options) {
186 std::cout << " " << option.name;
187 if (!option.value_name.empty()) {
188 std::cout << " <" << option.value_name << ">";
189 }
190 if (!option.description.empty()) {
191 std::cout << " " << option.description;
192 }
193 std::cout << "\n";
194 }
195}
196
197bool model_supports_task(const engine::runtime::ModelInspection & inspection, engine::runtime::VoiceTaskKind task) {
198 return std::any_of(
199 inspection.capabilities.supported_tasks.begin(),
200 inspection.capabilities.supported_tasks.end(),
201 [&](const engine::runtime::TaskCapability & capability) {
202 return capability.task == task;
203 });
204}
205
206void print_model_common_options(const engine::runtime::ModelInspection & inspection) {
207 std::cout << " Available input options:\n";
208 if (model_supports_task(inspection, engine::runtime::VoiceTaskKind::AudioGeneration)) {
209 std::cout
210 << " --text <text>\n"
211 << " --audio <wav>\n"
212 << " --batch-text-file <txt>\n"
213 << " --batch-text-dir <dir>\n"
214 << " --language <code>\n"
215 << " --duration-seconds <float>\n"
216 << " --guidance-scale <float>\n"
217 << " --num-inference-steps <n>\n"
218 << " --seed <n>\n"
219 << " --max-tokens <n>\n"
220 << " --temperature <float>\n"
221 << " --top-k <n>\n"
222 << " --top-p <float>\n"
223 << " --do-sample true|false\n";
224 }
225 if (model_supports_task(inspection, engine::runtime::VoiceTaskKind::Tts) ||
226 model_supports_task(inspection, engine::runtime::VoiceTaskKind::VoiceDesign) ||
227 model_supports_task(inspection, engine::runtime::VoiceTaskKind::VoiceCloning)) {
228 std::cout
229 << " --text <text>\n"
230 << " --batch-text-file <txt>\n"
231 << " --batch-text-dir <dir>\n"
232 << " --language <code>\n"
233 << " --voice-ref <wav>\n"
234 << " --voice-id <id>\n"

Callers 1

print_model_helpFunction · 0.85

Calls 1

model_supports_taskFunction · 0.85

Tested by

no test coverage detected