| 328 | } |
| 329 | |
| 330 | void NeuralPiAudioProcessor::loadConfig(File configFile) |
| 331 | { |
| 332 | this->suspendProcessing(true); |
| 333 | String path = configFile.getFullPathName(); |
| 334 | char_filename = path.toUTF8(); |
| 335 | |
| 336 | try { |
| 337 | // Check input size for conditioned models |
| 338 | // read JSON file |
| 339 | std::ifstream i2(char_filename); |
| 340 | nlohmann::json weights_json; |
| 341 | i2 >> weights_json; |
| 342 | |
| 343 | int input_size_json = weights_json["/model_data/input_size"_json_pointer]; |
| 344 | LSTM.input_size = input_size_json; |
| 345 | if (input_size_json == 1) { |
| 346 | is_conditioned = false; |
| 347 | LSTM.load_json(char_filename); |
| 348 | } |
| 349 | else { |
| 350 | is_conditioned = true; |
| 351 | LSTM.load_json2(char_filename); |
| 352 | } |
| 353 | model_loaded = 1; |
| 354 | } |
| 355 | catch (const std::exception& e) { |
| 356 | DBG("Unable to load json file: " + configFile.getFullPathName()); |
| 357 | std::cout << e.what(); |
| 358 | } |
| 359 | |
| 360 | this->suspendProcessing(false); |
| 361 | } |
| 362 | |
| 363 | void NeuralPiAudioProcessor::loadIR(File irFile) |
| 364 | { |
no test coverage detected