Files
sunnypilot/selfdrive/modeld/tinygrad_helpers.py
Jason Wen 10a33a4bf1 tg: reapply changes (#1817)
* Reapply "bump tg (#37700)"

This reverts commit 9022b4d322.

* fixup! Reapply "bump tg (#37700)"

* Revert "Revert "autodetect tg backend (#37778)""

This reverts commit b782958a

* Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)"

This reverts commit 3fa6726f88.

* Reapply "Modeld: support uncompiled"

This reverts commit 8c240cc1a4.

* fixup! Reapply "bump tg (#37700)"

* fixup! Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)"

* fixup! Revert "Revert "autodetect tg backend (#37778)""

* fixup! Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)"

* fixup! Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)"

* fixup! Revert "Revert "autodetect tg backend (#37778)""

* fixup! Reapply "bump tg (#37700)"

* fixup! Reapply "bump tg (#37700)"
2026-04-26 01:32:55 -04:00

13 lines
346 B
Python

import json
import os
from pathlib import Path
MODELS_DIR = Path(__file__).parent / 'models'
COMPILED_FLAGS_PATH = MODELS_DIR / 'tg_compiled_flags.json'
def set_tinygrad_backend_from_compiled_flags() -> None:
if os.path.isfile(COMPILED_FLAGS_PATH):
with open(COMPILED_FLAGS_PATH) as f:
os.environ['DEV'] = str(json.load(f)['DEV'])