| 559 | std::filesystem::create_directories(path.parent_path()); |
| 560 | } |
| 561 | std::ofstream out(path); |
| 562 | out << word_timestamps_to_json(result.word_timestamps) << "\n"; |
| 563 | std::cout << "words_out=" << path.string() << "\n"; |
| 564 | } |
| 565 | |
| 566 | engine::core::BackendConfig parse_step_backend( |
| 567 | const engine::io::json::Value & step, |
| 568 | engine::core::BackendConfig fallback) { |
| 569 | if (const auto backend = workflow_optional_string(step, "backend")) { |
| 570 | fallback.type = minitts::cli::parse_backend(*backend); |
| 571 | } |
| 572 | if (const auto device = workflow_optional_number(step, "device")) { |
| 573 | fallback.device = static_cast<int>(*device); |
| 574 | } |
| 575 | if (const auto threads = workflow_optional_number(step, "threads")) { |
| 576 | fallback.threads = static_cast<int>(*threads); |
| 577 | } |
| 578 | if (fallback.threads <= 0) { |
| 579 | throw std::runtime_error("workflow step threads must be positive"); |
| 580 | } |
no test coverage detected