mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-17 23:32:07 +08:00
21538e5a09
* pick fastest * save config * fix * Ignore generated tg_compiled_flags file * helper * cleaner * whitespace not needed * no shebang * whitespace
12 lines
300 B
Python
12 lines
300 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:
|
|
with open(COMPILED_FLAGS_PATH) as f:
|
|
os.environ['DEV'] = str(json.load(f)['DEV'])
|