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

Function parse_step_backend

app/workflow/workflow.cpp:561–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
566engine::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 }

Callers 3

run_model_step_implFunction · 0.85
run_chunked_model_stepFunction · 0.85
run_model_step_foreachFunction · 0.85

Calls 3

workflow_optional_stringFunction · 0.85
workflow_optional_numberFunction · 0.85
parse_backendFunction · 0.50

Tested by

no test coverage detected