Skip to content

Commit 5f01f72

Browse files
committed
lazy-import model system in inference service
1 parent c94bdce commit 5f01f72

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/inference/service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
from game.actions import ACTION_SPACE
1313
from game.board import AtaxxBoard
1414
from game.types import Move
15-
from model.system import AtaxxZero
1615

1716
if TYPE_CHECKING:
1817
from engine.mcts import MCTS
18+
from model.system import AtaxxZero
1919

2020
InferenceMode = Literal["fast", "strong"]
2121

@@ -133,6 +133,8 @@ def _require_torch() -> ModuleType:
133133
return torch_module
134134

135135
def _load_system(self) -> AtaxxZero:
136+
from model.system import AtaxxZero
137+
136138
torch_module = self._require_torch()
137139
ckpt = self.checkpoint_path
138140
if ckpt.suffix == ".ckpt":

0 commit comments

Comments
 (0)