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