mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-08 11:25:51 +08:00
* Reapply "bump tg (#37700)" This reverts commit9022b4d322. * fixup! Reapply "bump tg (#37700)" * Revert "Revert "autodetect tg backend (#37778)"" This reverts commitb782958a* Reapply "autodetect tg backend: use CPU:LLVM on Linux (#37785)" This reverts commit3fa6726f88. * Reapply "Modeld: support uncompiled" This reverts commit8c240cc1a4. * 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)"
13 lines
346 B
Python
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'])
|