mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-31 21:43:43 +08:00
do we need this
This commit is contained in:
@@ -366,15 +366,15 @@ def main(demo=False):
|
||||
import threading
|
||||
def load():
|
||||
nonlocal model
|
||||
model = ModelState(cam_w=vipc_client_main.width, cam_h=vipc_client_main.height, chestnut=True)
|
||||
try:
|
||||
model = ModelState(cam_w=vipc_client_main.width, cam_h=vipc_client_main.height, chestnut=True)
|
||||
except Exception:
|
||||
cloudlog.exception("chestnut big model load failed")
|
||||
t = threading.Thread(target=load, daemon=True)
|
||||
t.start()
|
||||
t.join(60)
|
||||
if model is None:
|
||||
params.put_bool("ChestnutActive", False)
|
||||
raise RuntimeError("chestnut model load failed or timed out (60s)")
|
||||
params.put_bool("ChestnutActive", True)
|
||||
else:
|
||||
params.put_bool("ChestnutActive", model is not None)
|
||||
if model is None:
|
||||
model = ModelState(cam_w=vipc_client_main.width, cam_h=vipc_client_main.height, chestnut=False)
|
||||
|
||||
params.put_bool("ChestnutLoading", False)
|
||||
|
||||
Reference in New Issue
Block a user