Snider Virgil commited on
Commit ·
aeeba46
1
Parent(s): 70f85ef
fix(probe): system-python capability check via ollama binary
Browse filesThe earlier fix probed 'openai' via import at the install.sh /
lem-eval.sh level, but those scripts run in the SYSTEM python outside
the uv venv where openai isn't installed. So charon correctly saw
mlx_lm as unavailable but then also failed the gguf probe and
reported 'no target types detected'.
Switch to a presence check: ollama binary in PATH → gguf capability.
That's the right proxy anyway — we run gguf via Ollama's OpenAI
endpoint, and if ollama isn't installed we can't run anyway.
mlx probe unchanged (only meaningful on Darwin).
Co-Authored-By: Virgil <virgil@lethean.io>
Files changed (2)
- install.sh+10-10
- lem-eval.sh+7-9
66 unmodified lines6768697071727374757677787980818283848566 unmodified linesallowed = set(t.strip() for t in types_env.split(","))else:allowed = set()try:import mlx_lm # noqa: F401if platform.system() == "Darwin":allowed.add("mlx")except ImportError:passtry:import openai # noqa: F401allowed.add("gguf")except ImportError:passif not allowed:print(" no target types detected (need mlx_lm or openai); set LEM_TYPES=gguf to override")def derive_repo_id(this_ref):"""Strip Ollama hf.co/ prefix and :<tag> suffix to get a clone-able repo id."""66 unmodified lines6768697071727374757677787980818283848566 unmodified linesallowed = set(t.strip() for t in types_env.split(","))else:allowed = set()if platform.system() == "Darwin":try:import mlx_lm # noqa: F401allowed.add("mlx")except ImportError:pass# gguf availability = ollama binary present anywhere we'd hit it fromif any(os.path.exists(os.path.join(p, "ollama"))for p in os.environ.get("PATH", "").split(":")):allowed.add("gguf")if not allowed:print(" no target types detected (need mlx_lm on Darwin or ollama on PATH); ""set LEM_TYPES to override")def derive_repo_id(this_ref):"""Strip Ollama hf.co/ prefix and :<tag> suffix to get a clone-able repo id."""
108 unmodified lines109110111112113114115116117118119120121122123124125108 unmodified linesallowed = set(t.strip() for t in types_env.split(","))else:allowed = set()try:import mlx_lm # noqa: F401if platform.system() == "Darwin":allowed.add("mlx")except ImportError:passtry:import openai # noqa: F401allowed.add("gguf")except ImportError:passdef derive_repo_id(this_ref):if this_ref.startswith("hf.co/"):108 unmodified lines109110111112113114115116117118119120121122123108 unmodified linesallowed = set(t.strip() for t in types_env.split(","))else:allowed = set()if platform.system() == "Darwin":try:import mlx_lm # noqa: F401allowed.add("mlx")except ImportError:passif any(os.path.exists(os.path.join(p, "ollama"))for p in os.environ.get("PATH", "").split(":")):allowed.add("gguf")def derive_repo_id(this_ref):if this_ref.startswith("hf.co/"):
install.sh+10-10
lem-eval.sh+7-9