From b3c822cfd71a4c72af5811379daeb26b87d5982f Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 19 Jul 2026 12:30:09 -0400 Subject: [PATCH] sync: fix model switching --- openpilot/sunnypilot/models/helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpilot/sunnypilot/models/helpers.py b/openpilot/sunnypilot/models/helpers.py index 28517ab2f3..a9156ac62e 100644 --- a/openpilot/sunnypilot/models/helpers.py +++ b/openpilot/sunnypilot/models/helpers.py @@ -27,9 +27,10 @@ _LAST_VALIDATED_RAW = None def _compute_hash(file_path: str) -> str | None: - from openpilot.common.file_chunker import read_file_chunked + from openpilot.common.file_chunker import open_file_chunked try: - return hashlib.sha256(read_file_chunked(file_path)).hexdigest().lower() + with open_file_chunked(file_path) as file: + return hashlib.file_digest(file, "sha256").hexdigest().lower() except FileNotFoundError: return None