Download src/macjev/runtime/RUNTIME_SWITCH.diff from VTN-TokenFactory/Telasap-0.8B-v1.0: direct link, hf CLI and curl.
- Browser
- Download file 2.33 kB
-
https://huggingface.co/VTN-TokenFactory/Telasap-0.8B-v1.0/resolve/main/src/macjev/runtime/RUNTIME_SWITCH.diff
- Command line
-
hf download hf://VTN-TokenFactory/Telasap-0.8B-v1.0/src/macjev/runtime/RUNTIME_SWITCH.diff
-
curl -L -o RUNTIME_SWITCH.diff https://huggingface.co/VTN-TokenFactory/Telasap-0.8B-v1.0/resolve/main/src/macjev/runtime/RUNTIME_SWITCH.diff
2.33 kB
| --- a/src/mac_laya/inference.py | |
| +++ b/src/mac_laya/inference.py | |
| """Local decision engine for either the immutable official base or a verified release.""" | |
| import json | |
| +import os | |
| from pathlib import Path | |
| import time | |
| from .artifacts import ROOT,sha256 | |
| from .model import load_base,build_sequence,collate,upstream | |
| +MACJEV_RELEASE=ROOT/"models/macjev-release" | |
| + | |
| +def _macjev_available(release=None): | |
| + """Use the MacJev engine when its release exists (or an explicit MacJev release is passed).""" | |
| + if os.environ.get("MAC_LAYA_FORCE_LAYA")=="1":return None | |
| + path=Path(release) if release else MACJEV_RELEASE | |
| + return path if (path/"release_config.json").exists() else None | |
| + | |
| + | |
| class DecisionEngine: | |
| + def __new__(cls,release=None,*args,**kwargs): | |
| + macjev_release=_macjev_available(release) | |
| + if macjev_release is not None: | |
| + import sys | |
| + src=str(ROOT/"src") | |
| + if src not in sys.path:sys.path.insert(0,src) | |
| + from macjev.runtime.engine import DecisionEngine as MacJevEngine | |
| + # backend: release_config.json "backend" (default llama.cpp GGUF F16, then MLX fp32-act, then torch; | |
| + # any fallback is reported in each result's backend_note); MACJEV_BACKEND=llama.cpp|mlx|torch overrides | |
| + # budgets from release_config.json: up to 25,600 input tokens (macjev.render.CONTEXT_LIMIT, 2026-09-24); | |
| + # the Mac gate view sends ~20K tokens of history with explicit truncation markers (macjev/mac/RUNTIME_PATCH.diff) | |
| + return MacJevEngine(macjev_release,backend=os.environ.get("MACJEV_BACKEND") or None) | |
| + return super().__new__(cls) | |
| + | |
| def __init__(self,release=None): | |
| if not torch.backends.mps.is_available():raise RuntimeError("MPS unavailable; no silent fallback") | |
| torch.set_num_threads(8);torch.mps.set_per_process_memory_fraction(.55) | |
| "entropy_concentration":upstream.confidence_from_probs(__import__("numpy").array(p),len(p)), | |
| "input_tokens":len(ids),"latency_ms":(time.monotonic()-started)*1000,"model":self.label, | |
| "acceptance_status":self.acceptance_status} | |
| + def decide_many(self,state,questions): | |
| + return [self.decide(state,q) for q in questions] | |