| 12 | |
| 13 | HTDemucsManifest parse_package_manifest(const assets::ResourceBundle & resources) { |
| 14 | const auto manifest = resources.parse_json("manifest"); |
| 15 | HTDemucsManifest out; |
| 16 | out.model_type = json::require_string(manifest, "model_type"); |
| 17 | out.name = json::require_string(manifest, "name"); |
| 18 | |
| 19 | if (out.model_type == "demucs_single") { |
| 20 | (void) manifest.require("model"); |
| 21 | } else if (out.model_type == "demucs_single_alias") { |
| 22 | (void) manifest.require("model"); |
| 23 | } else if (out.model_type == "demucs_bag") { |
| 24 | throw std::runtime_error("HTDemucs package-spec loader currently supports only single-model manifests"); |
| 25 | } else { |
no test coverage detected