File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 11TYPECHECK = True
22DEBUG = False
33DEEPSPEED_CHECKPOINTING = False
4+ USE_NIM = False
Original file line number Diff line number Diff line change @@ -101,6 +101,9 @@ def package_available(package_name: str) -> bool:
101101 HAS_NIM = False
102102 NIM_VERSION = None
103103
104+ USE_NIM = env .bool ('USE_NIM' , HAS_NIM )
105+
106+ assert not (USE_NIM and not HAS_NIM ), 'you cannot use Nim if it is not available'
104107assert not HAS_NIM or version .parse (NIM_VERSION ) >= version .parse ('2.0.8' ), 'nim version must be 2.0.8 or above'
105108
106109# check is github ci
@@ -136,5 +139,6 @@ def package_available(package_name: str) -> bool:
136139 beartype_isinstance ,
137140 checkpoint ,
138141 IS_DEBUGGING ,
139- IS_GITHUB_CI
142+ IS_GITHUB_CI ,
143+ USE_NIM
140144]
You can’t perform that action at this time.
0 commit comments