Spaces:
Sleeping
Sleeping
Thibault Duplessis commited on
Commit ·
1486048
1
Parent(s): 139d68a
retry to instanciate engine
Browse files- engine_wrapper.py +2 -1
engine_wrapper.py
CHANGED
|
@@ -2,9 +2,10 @@ import os
|
|
| 2 |
import chess
|
| 3 |
import chess.xboard
|
| 4 |
import chess.uci
|
|
|
|
| 5 |
|
|
|
|
| 6 |
def create_engine(config, board):
|
| 7 |
-
# print("Loading Engine!")
|
| 8 |
cfg = config["engine"]
|
| 9 |
engine_path = os.path.join(cfg["dir"], cfg["name"])
|
| 10 |
weights = os.path.join(cfg["dir"], cfg["weights"]) if "weights" in cfg else None
|
|
|
|
| 2 |
import chess
|
| 3 |
import chess.xboard
|
| 4 |
import chess.uci
|
| 5 |
+
import backoff
|
| 6 |
|
| 7 |
+
@backoff.on_exception(backoff.expo, BaseException, max_time=120)
|
| 8 |
def create_engine(config, board):
|
|
|
|
| 9 |
cfg = config["engine"]
|
| 10 |
engine_path = os.path.join(cfg["dir"], cfg["name"])
|
| 11 |
weights = os.path.join(cfg["dir"], cfg["weights"]) if "weights" in cfg else None
|