From a697daa669362b0bd972555819e4b8174ffa13ea Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 22 Aug 2026 16:50:54 -0400 Subject: [PATCH] simplify --- openpilot/selfdrive/modeld/modeld.py | 4 +--- openpilot/sunnypilot/modeld_v2/modeld.py | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/openpilot/selfdrive/modeld/modeld.py b/openpilot/selfdrive/modeld/modeld.py index 36a309cf19..0f1b50b810 100755 --- a/openpilot/selfdrive/modeld/modeld.py +++ b/openpilot/selfdrive/modeld/modeld.py @@ -146,9 +146,7 @@ class ModelState(ModelStateBase): ModelStateBase.__init__(self) input_devices = get_tg_input_devices(PROCESS_NAME, usbgpu) self.WARP_DEV, self.QUEUE_DEV = input_devices['WARP_DEV'], input_devices['QUEUE_DEV'] - pkl_path = modeld_pkl_path(usbgpu) - stream = open_with_progress(pkl_path) if usbgpu else open_file_chunked(pkl_path) - jits = load_oob(stream) + jits = load_oob(open_with_progress(modeld_pkl_path(usbgpu)) if usbgpu else open_file_chunked(modeld_pkl_path(usbgpu))) metadata = jits['metadata'] self.input_shapes = metadata['input_shapes'] self.vision_input_names = [k for k in self.input_shapes if 'img' in k] diff --git a/openpilot/sunnypilot/modeld_v2/modeld.py b/openpilot/sunnypilot/modeld_v2/modeld.py index 815c932805..001c30518d 100755 --- a/openpilot/sunnypilot/modeld_v2/modeld.py +++ b/openpilot/sunnypilot/modeld_v2/modeld.py @@ -108,8 +108,7 @@ class ModelState(ModelStateBase): def _init_combined(self, pkl_path, cam_w, cam_h, bundle): cloudlog.warning(f"loading combined pkl: {pkl_path}") - stream = open_with_progress(pkl_path) if self.usbgpu else open_file_chunked(pkl_path) - jits = load_oob(stream) + jits = load_oob(open_with_progress(pkl_path) if self.usbgpu else open_file_chunked(pkl_path)) self.WARP_DEV = 'QCOM' if COMMA_HARDWARE else 'CPU' self.DEV = 'AMD' if self.usbgpu else self.WARP_DEV