Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

improved tests in case main library is not installed, skip in that case

matteoa4eaaa9d42ee
diff --git a/c/tests/test_convert_gguf_to_olmoe.py b/c/tests/test_convert_gguf_to_olmoe.py
index e434ab69..4bb9d31a 100644
--- a/c/tests/test_convert_gguf_to_olmoe.py
+++ b/c/tests/test_convert_gguf_to_olmoe.py
@@ -18,7 +18,14 @@ import tempfile
import unittest
from pathlib import Path
-import numpy as np
+import importlib
+
+try:
+ import numpy as np
+ for _dependency in ("safetensors", "safetensors.numpy"):
+ importlib.import_module(_dependency)
+except ImportError as exc:
+ raise unittest.SkipTest("numpy/safetensors not installed: %s" % exc)
TESTDIR = Path(__file__).resolve().parent
TOOLS = TESTDIR.parent / "tools"
diff --git a/c/tests/test_gguf_dequant.py b/c/tests/test_gguf_dequant.py
index 2e3df9dc..ef48fe62 100644
--- a/c/tests/test_gguf_dequant.py
+++ b/c/tests/test_gguf_dequant.py
@@ -16,7 +16,10 @@ import sys
import unittest
from pathlib import Path
-import numpy as np
+try:
+ import numpy as np
+except ImportError as exc:
+ raise unittest.SkipTest("numpy not installed: %s" % exc)
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "tools"))
diff --git a/c/tests/test_gguf_olmoe_profile.py b/c/tests/test_gguf_olmoe_profile.py
index 82ae7508..d679bb2d 100644
--- a/c/tests/test_gguf_olmoe_profile.py
+++ b/c/tests/test_gguf_olmoe_profile.py
@@ -12,7 +12,10 @@ import sys
import unittest
from pathlib import Path
-import numpy as np
+try:
+ import numpy as np
+except ImportError as exc:
+ raise unittest.SkipTest("numpy not installed: %s" % exc)
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "tools"))