Skip to content

Commit 6931bdc

Browse files
committed
able to turn off nim even if available
1 parent d158479 commit 6931bdc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
TYPECHECK=True
22
DEBUG=False
33
DEEPSPEED_CHECKPOINTING=False
4+
USE_NIM=False

alphafold3_pytorch/tensor_typing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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'
104107
assert 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
]

0 commit comments

Comments
 (0)