Skip to content

Commit b70a10b

Browse files
committed
Test module fixes
1 parent e9039fc commit b70a10b

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

backend_service/inference.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,8 +1852,13 @@ def load_model(
18521852
# particular model architecture.
18531853
attempts: list[tuple[str, bool, bool]] = [(cache_strategy, fit_model_in_memory, False)]
18541854
if cache_strategy not in ("native", "chaosengine"):
1855-
chaosengine_strat = _strategy_registry.get("chaosengine")
1856-
if chaosengine_strat and chaosengine_strat.is_available():
1855+
# Always include ChaosEngine as an intermediate fallback. Its
1856+
# llama.cpp path only emits standard cache-type flags (q4_0 etc.)
1857+
# and runs on the standard binary — it does NOT require the
1858+
# chaos_engine Python package to be installed. Gating on
1859+
# is_available() would skip this fallback on CI / dev machines
1860+
# that don't have the package, breaking the 3-level chain.
1861+
if _strategy_registry.get("chaosengine") is not None:
18571862
attempts.append(("chaosengine", False, True))
18581863
if cache_strategy != "native":
18591864
attempts.append(("native", False, True))

dflash/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ def is_ddtree_available() -> bool:
169169
DDTree requires the same dflash_mlx runtime as linear DFlash, plus
170170
access to ``dflash_mlx.runtime`` primitives for tree verification.
171171
"""
172-
runtime_spec = importlib.util.find_spec("dflash_mlx.runtime")
172+
try:
173+
runtime_spec = importlib.util.find_spec("dflash_mlx.runtime")
174+
except ModuleNotFoundError:
175+
return False
173176
if runtime_spec is None:
174177
return False
175178
runtime_path = getattr(runtime_spec, "origin", None)

0 commit comments

Comments
 (0)