style: format

This commit is contained in:
Andy Lee
2025-08-25 15:48:04 -07:00
parent 3d79741f9c
commit 75c8aeee5f
3 changed files with 9 additions and 3 deletions

View File

@@ -1 +1 @@
downloads/
downloads/

View File

@@ -416,6 +416,7 @@ def main():
# Build non-compact index for fast binary search (recompute_embeddings=False)
from pathlib import Path
index_path = Path(args.index)
non_compact_index_path = str(index_path.parent / f"{index_path.stem}_noncompact.leann")
enron_eval.create_non_compact_index_for_comparison(non_compact_index_path)
@@ -428,6 +429,7 @@ def main():
results_out["stage3"] = sweep
# Persist default stage 3 results near the index for Stage 4 auto-pickup
from pathlib import Path
default_stage3_path = Path(args.index).parent / "enron_stage3_results.json"
with open(default_stage3_path, "w", encoding="utf-8") as f:
json.dump({"stage3": sweep}, f, indent=2)
@@ -476,7 +478,9 @@ def main():
prev = json.load(f)
complexity = prev.get("stage3", {}).get("best_complexity")
if complexity is None:
raise SystemExit("❌ Stage 4: No --complexity and no best_complexity found in saved Stage 3 results")
raise SystemExit(
"❌ Stage 4: No --complexity and no best_complexity found in saved Stage 3 results"
)
print(f"📥 Using best complexity from saved Stage 3: {complexity}")
else:
raise SystemExit(

View File

@@ -274,7 +274,9 @@ class HNSWSearcher(BaseSearcher):
return self._id_map[x]
return str(x)
string_labels = [[map_label(int(l)) for l in batch_labels] for batch_labels in labels]
string_labels = [
[map_label(int(label)) for label in batch_labels] for batch_labels in labels
]
else:
string_labels = [
[str(int_label) for int_label in batch_labels] for batch_labels in labels