feat(loader): add load_zaya_model wrapper around mlx-lm.load

This commit is contained in:
transcrilive
2026-05-10 02:58:55 +02:00
parent 4b55163a5c
commit c5584b6396
3 changed files with 52 additions and 0 deletions

25
tests/test_loader.py Normal file
View File

@@ -0,0 +1,25 @@
import pytest
from markovian_rsa_mlx.loader import resolve_model_path
def test_resolve_local_path_passthrough(tmp_path):
# local dir is returned as-is
d = tmp_path / "weights"
d.mkdir()
assert resolve_model_path(str(d)) == str(d)
def test_resolve_hf_id_format_unchanged():
# HF repo id is returned as-is (load_model handles download)
assert resolve_model_path("kyr0/zaya1-base-8b-MLX") == "kyr0/zaya1-base-8b-MLX"
@pytest.mark.integration
def test_load_real_zaya_q4_smoke():
"""Hits the actual Q4 weights — slow, requires HF cache."""
from markovian_rsa_mlx.loader import load_zaya_model
model, tokenizer = load_zaya_model("kyr0/zaya1-base-8b-MLX")
assert model is not None
assert tokenizer is not None
assert hasattr(tokenizer, "encode")
assert hasattr(tokenizer, "decode")