From 08eef47ce259a16c0f975a2088a8e7405161ede1 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 17 Mar 2025 22:31:59 -0400 Subject: [PATCH] just use file name --- sunnypilot/selfdrive/controls/lib/nnlc/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py b/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py index d295632015..4627133c65 100644 --- a/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py +++ b/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py @@ -30,7 +30,7 @@ def get_nn_model_path(CP: structs.CarParams) -> tuple[str | None, str, bool]: _max_similarity = -1.0 for f in os.listdir(TORQUE_NN_MODEL_PATH): if f.endswith(".json"): - model = f.replace(".json", "").replace(f"{TORQUE_NN_MODEL_PATH}/", "") + model = os.path.splitext(f)[0] similarity_score = similarity(model, _check_model) if similarity_score > _max_similarity: _max_similarity = similarity_score