Skip to content

Commit

Permalink
NNFF: use substitute.toml as fallback for model lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
twilsonco committed Dec 16, 2024
1 parent cfb7c52 commit 1976e6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions selfdrive/car/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,17 @@ def check_nn_path(check_model):
return model_path

def get_nn_model(car, eps_firmware) -> tuple[FluxModel | None, float]:
with open(TORQUE_SUBSTITUTE_PATH, 'rb') as f:
sub = tomllib.load(f)
model = get_nn_model_path(car, eps_firmware)
if model is not None:
model = FluxModel(model)
else:
sub_candidate = sub.get(car, car)
if sub_candidate != car:
model = get_nn_model_path(sub_candidate, eps_firmware)
if model is not None:
model = FluxModel(model)
return model

# generic car and radar interfaces
Expand Down

0 comments on commit 1976e6e

Please sign in to comment.