| 30 | |
| 31 | HTDemucsConfig parse_config(const assets::ResourceBundle & resources) { |
| 32 | const auto root = resources.parse_json("submodel_config"); |
| 33 | HTDemucsConfig config; |
| 34 | config.class_name = json::require_string(root, "class_name"); |
| 35 | if (config.class_name != "HTDemucs") { |
| 36 | throw std::runtime_error("Only HTDemucs class_name is supported, got: " + config.class_name); |
| 37 | } |
| 38 | config.signature = json::require_string(root, "signature"); |
| 39 | config.checkpoint_file = json::require_string(root, "checkpoint_file"); |
| 40 | config.sources = json::require_string_array(root, "sources"); |
| 41 | config.audio_channels = json::require_i64(root, "audio_channels"); |
| 42 | config.sample_rate = json::require_i64(root, "samplerate"); |
| 43 | config.segment_seconds = json::require_f32(root, "segment"); |
no test coverage detected