Skip to content

Commit 49a9768

Browse files
Merge pull request #17 from scbirlab/dev
Fix GPU-blocking bug
2 parents c794283 + cac117d commit 49a9768

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

yunta/interactions/runner.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class Runner(ABC):
139139
use_id = False
140140

141141
@staticmethod
142-
def make_model(cpu=True, **kwargs):
142+
def make_model(cpu=False, **kwargs):
143143
return None
144144

145145
@staticmethod
@@ -165,7 +165,7 @@ def run(
165165
msa2: Optional[MSA] = None,
166166
max_gap_fraction: float = .9,
167167
interaction_map: Optional[Union[str, Mapping[str, Iterable[str]]]] = None,
168-
cpu: bool = True,
168+
cpu: bool = False,
169169
model: Optional[Callable] = None,
170170
chunksize: int = DEFAULT_CHUNKSIZE,
171171
enforce_ref_match: bool = False,
@@ -221,7 +221,7 @@ class AF2Runner(Runner):
221221

222222
@staticmethod
223223
def make_model(
224-
cpu=True,
224+
cpu=False,
225225
max_recycles: int = 10,
226226
param_dir: Optional[str] = None,
227227
**kwargs
@@ -295,11 +295,14 @@ class RF2TRunner(Runner):
295295
metric_container = RF2TMetrics
296296

297297
@staticmethod
298-
def make_model(cpu=True, **kwargs):
298+
def make_model(cpu=False, **kwargs):
299299
from rf2t_micro.predict_msa import Predictor
300300
import torch
301-
if not cpu:
301+
if not cpu and torch.cuda.is_available():
302+
print_err("[INFO] Using GPU for RF2t")
302303
torch.cuda.empty_cache()
304+
else:
305+
print_err("[INFO] Using CPU for RF2t")
303306
model = Predictor(use_cpu=cpu)
304307
return model
305308

0 commit comments

Comments
 (0)