Skip to content

Commit

Permalink
CI: Test loading and running models (#120)
Browse files Browse the repository at this point in the history
* build.yml: Add test step

* Fixes
  • Loading branch information
sdatkinson authored Oct 10, 2024
1 parent cc8dc8c commit 14348a9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ jobs:
run: |
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
cmake --build . --config $BUILD_TYPE -j4
- name: Run tests
working-directory: ${{github.workspace}}
run: |
./build/tools/benchmodel ./example_models/wavenet.nam
./build/tools/benchmodel ./example_models/lstm.nam
2 changes: 1 addition & 1 deletion NAM/get_dsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ std::unique_ptr<DSP> get_dsp(const std::filesystem::path config_filename)
std::unique_ptr<DSP> get_dsp(const std::filesystem::path config_filename, dspData& returnedConfig)
{
if (!std::filesystem::exists(config_filename))
throw std::runtime_error("Config JSON doesn't exist!\n");
throw std::runtime_error("Config file doesn't exist!\n");
std::ifstream i(config_filename);
nlohmann::json j;
i >> j;
Expand Down
1 change: 1 addition & 0 deletions example_models/lstm.nam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version": "0.5.4", "metadata": {"date": {"year": 2024, "month": 10, "day": 9, "hour": 18, "minute": 44, "second": 41}, "loudness": -37.8406867980957, "gain": 0.13508800804658277, "name": "Test LSTM", "modeled_by": "Steve", "gear_type": "amp", "gear_make": "Darkglass Electronics", "gear_model": "Microtubes 900 v2", "tone_type": "clean", "input_level_dbu": 18.3, "output_level_dbu": 12.3, "training": {"settings": {"ignore_checks": false}, "data": {"latency": {"manual": null, "calibration": {"algorithm_version": 1, "delays": [-16], "safety_factor": 1, "recommended": -17, "warnings": {"matches_lookahead": false, "disagreement_too_high": false}}}, "checks": {"version": 3, "passed": true}}, "validation_esr": null}}, "architecture": "LSTM", "config": {"input_size": 1, "hidden_size": 3, "num_layers": 1}, "weights": [-0.21677088737487793, -0.6683622002601624, -0.2560940980911255, -0.3588429093360901, 0.17952610552310944, 0.19445613026618958, -0.01662646047770977, 0.5353694558143616, -0.2536540627479553, -0.5132213234901428, -0.020476307719945908, 0.08592455089092255, -0.6891753673553467, 0.3627359867095947, 0.008421811275184155, 0.3113192617893219, 0.14251480996608734, 0.07989779114723206, -0.18211324512958527, 0.7118963003158569, 0.41084015369415283, -0.6571938395500183, -0.13214066624641418, -0.2698603868484497, 0.49387243390083313, -0.3491725027561188, 0.6353667974472046, -0.5005152225494385, 0.2052856683731079, -0.4301638901233673, -0.15770092606544495, -0.7181791067123413, 0.056290093809366226, -0.49049463868141174, 0.6623441576957703, 0.09029324352741241, 0.34005245566368103, 0.16416560113430023, 0.15520110726356506, -0.4155678153038025, -0.36928507685661316, 0.3211132884025574, -0.6769840121269226, -0.1575538069009781, 0.05268515646457672, -0.4191459119319916, 0.599330484867096, 0.21518059074878693, -4.246325492858887, -3.315647840499878, -4.328850746154785, 4.496089458465576, 5.015639305114746, 3.6492037773132324, 0.14431169629096985, -0.6633821725845337, 0.11673200130462646, -0.1418764889240265, -0.4897872805595398, -0.8689419031143188, -0.06714004278182983, -0.4450395107269287, -0.02142983116209507, -0.15136894583702087, -2.775207996368408, -0.08681213855743408, 0.05702732503414154, 0.670292317867279, 0.31442636251449585, 0.30793967843055725], "sample_rate": 48000}
1 change: 1 addition & 0 deletions example_models/wavenet.nam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version": "0.5.4", "metadata": {"date": {"year": 2024, "month": 10, "day": 9, "hour": 18, "minute": 32, "second": 27}, "loudness": -20.020729064941406, "gain": 0.19575619747898518, "name": "Test Model", "modeled_by": "Steve", "gear_type": "amp", "gear_make": "Darkglass Electronics", "gear_model": "Microtubes 900 v2", "tone_type": "clean", "input_level_dbu": 18.3, "output_level_dbu": 12.3, "training": {"settings": {"ignore_checks": false}, "data": {"latency": {"manual": null, "calibration": {"algorithm_version": 1, "delays": [-16], "safety_factor": 1, "recommended": -17, "warnings": {"matches_lookahead": false, "disagreement_too_high": false}}}, "checks": {"version": 3, "passed": true}}, "validation_esr": 0.13345033695550146}}, "architecture": "WaveNet", "config": {"layers": [{"input_size": 1, "condition_size": 1, "head_size": 2, "channels": 3, "kernel_size": 3, "dilations": [1, 2], "activation": "Tanh", "gated": false, "head_bias": false}, {"input_size": 3, "condition_size": 1, "head_size": 1, "channels": 2, "kernel_size": 3, "dilations": [8], "activation": "Tanh", "gated": false, "head_bias": true}], "head": null, "head_scale": 0.02}, "weights": [-0.6180188059806824, 1.0314024686813354, -1.0111560821533203, -0.38462021946907043, 0.35968291759490967, 0.5255971550941467, 0.19149275124073029, -0.18075695633888245, -0.33711034059524536, -0.21037575602531433, 0.2007753700017929, 0.21644853055477142, -1.3216396570205688, -0.35082393884658813, 0.43541353940963745, 0.9693092107772827, 0.2394428700208664, -0.41078877449035645, -1.193748116493225, -0.14876757562160492, 0.8413559198379517, 0.24491633474826813, 0.8857091665267944, 0.5647665858268738, 0.08301573246717453, -0.801490843296051, 0.168976828455925, -0.5413634181022644, 0.484220415353775, 0.021656272932887077, -0.15155009925365448, 0.07081033289432526, 0.00019397131109144539, -0.7408013939857483, -1.3308452367782593, -1.0403972864151, 0.016809873282909393, 0.6778652667999268, 0.28265541791915894, -0.28287461400032043, 1.0525944232940674, -0.6385797262191772, -0.2195468544960022, -0.3150196671485901, -0.8814508318901062, -0.2746180295944214, 0.15367186069488525, 0.22431065142154694, -0.056788790971040726, -0.38902369141578674, 0.5406259894371033, 0.3566059470176697, 0.14383991062641144, -0.25409433245658875, 0.16139137744903564, -0.05857989564538002, -0.18448838591575623, -0.253485769033432, -0.42405444383621216, -0.030114537104964256, 0.47283637523651123, 0.14930365979671478, -0.4410354793071747, -0.21976807713508606, -0.12736600637435913, -0.5674286484718323, -0.347588449716568, -0.3687525689601898, 0.4130803942680359, 0.8551775217056274, -0.05746064335107803, -0.38243237137794495, 0.20036561787128448, 0.25542038679122925, -0.0819990262389183, 0.19469600915908813, 0.10215214639902115, -0.26087674498558044, -0.1773151010274887, -0.09658292680978775, -0.7381710410118103, 0.7003506422042847, 0.7253592014312744, -0.07488955557346344, -0.23439547419548035, -0.5138604044914246, -0.7976311445236206, -0.8090851902961731, -0.37562188506126404, -1.163352131843567, 0.30907657742500305, 0.0564480796456337, 0.1190297082066536, 0.2310808300971985, -0.45360898971557617, -0.11524498462677002, 0.2552330493927002, 0.2913571298122406, -0.23171702027320862, -0.35578709840774536, 0.40732908248901367, 0.7458747029304504, 0.27514976263046265, -0.7503036856651306, -0.6707972884178162, -0.4248569905757904, -0.1671624332666397, -0.14162226021289825, 0.37550851702690125, -0.038120146840810776, 0.16232982277870178, -0.05173371359705925, -0.2842361629009247, 0.38820165395736694, 0.521754801273346, -0.3581869900226593, 0.21531476080417633, 0.11342520266771317, 0.01764630153775215, 0.07780527323484421, 0.9356631636619568, 0.04235581308603287, -0.3450177311897278, 0.3345951437950134, -0.678291380405426, -0.4191069006919861, -0.1770099401473999, -5.386871337890625, -5.130850791931152, -0.4049331247806549, 0.019999999552965164], "sample_rate": 48000}

0 comments on commit 14348a9

Please sign in to comment.