Skip to content

Kyojin: open-source engine that runs 100 GB-class open models (GLM-5.3, Qwen3.8, DeepSeek V4.1) on one desktop machine. AMD Strix Halo, NVIDIA RTX and Apple Mac. OpenAI API, built on ExLlamaV3.

Uncensor preset: find the direction file when the spec path is given by hand

YanissAmz20694b38e450
diff --git a/exllamav3/modules/ablit_runtime.py b/exllamav3/modules/ablit_runtime.py
index 82ec6a5..309fa00 100644
--- a/exllamav3/modules/ablit_runtime.py
+++ b/exllamav3/modules/ablit_runtime.py
@@ -69,10 +69,11 @@ def _load(path: str, source: str = "env"):
if r_file:
r_file = r_file if os.path.isabs(r_file) else os.path.join(d, r_file)
else:
- cands = [os.path.splitext(path)[0] + ".safetensors"]
+ # The direction sits next to the spec, as <spec>.safetensors or under the bundled name.
+ cands = [os.path.splitext(path)[0] + ".safetensors", os.path.join(d, BUNDLED_DIRECTION)]
if source == "bundled":
- cands.insert(0, os.path.join(d, BUNDLED_DIRECTION))
- r_file = next((c for c in cands if os.path.isfile(c)), cands[-1])
+ cands.reverse()
+ r_file = next((c for c in cands if os.path.isfile(c)), cands[0])
if not os.path.isfile(r_file):
raise FileNotFoundError(f"ablit runtime: direction file not found: {r_file} (spec {path})")
from safetensors import safe_open