| 34 | } |
| 35 | |
| 36 | std::vector<std::pair<std::string, std::string>> parse_session_options(int argc, char ** argv) { |
| 37 | std::vector<std::pair<std::string, std::string>> out; |
| 38 | for (int i = 1; i + 1 < argc; ++i) { |
| 39 | if (std::string(argv[i]) != "--session-option") { |
| 40 | continue; |
| 41 | } |
| 42 | const std::string option = argv[i + 1]; |
| 43 | const size_t eq = option.find('='); |
| 44 | if (eq == std::string::npos || eq == 0) { |
| 45 | throw std::runtime_error("invalid Stable Audio --session-option: " + option); |
| 46 | } |
| 47 | out.emplace_back(option.substr(0, eq), option.substr(eq + 1)); |
| 48 | } |
| 49 | return out; |
| 50 | } |
| 51 | |
| 52 | engine::core::BackendType parse_backend(const std::string & value) { |
| 53 | if (value == "cuda") { |