| 559 | throw std::runtime_error("workflow model step requested words_out but produced no word timestamps: " + id); |
| 560 | } |
| 561 | if (!path.parent_path().empty()) { |
| 562 | std::filesystem::create_directories(path.parent_path()); |
| 563 | } |
| 564 | std::ofstream out(path); |
| 565 | out << word_timestamps_to_json(result.word_timestamps) << "\n"; |
| 566 | std::cout << "words_out=" << path.string() << "\n"; |
| 567 | } |
| 568 | |
| 569 | engine::core::BackendConfig parse_step_backend( |
| 570 | const engine::io::json::Value & step, |
| 571 | engine::core::BackendConfig fallback) { |
| 572 | const auto backend = workflow_optional_string(step, "backend"); |
| 573 | const auto impl = workflow_optional_string(step, "backend_impl"); |
| 574 | const auto device = workflow_optional_number(step, "device"); |
| 575 | const auto device_name = workflow_optional_string(step, "device_name"); |
| 576 | if (device.has_value() && device_name.has_value()) { |
| 577 | throw std::runtime_error("workflow step cannot specify both device and device_name"); |
| 578 | } |
| 579 | if (backend.has_value()) { |
| 580 | fallback.type = minitts::cli::parse_backend(*backend); |
no test coverage detected