From 4b17f199afd39c24231e06a448caad45317b29e3 Mon Sep 17 00:00:00 2001 From: Safi Date: Sun, 31 May 2026 23:44:42 +0100 Subject: [PATCH] drop redundant labels-file write in cluster-only The auto-labeling branch wrote .graphify_labels.json, but the unconditional write at the end of cluster-only already persists the final labels dict (LLM or placeholder). Removed the duplicate; no behavior change. Co-Authored-By: Claude Opus 4.8 --- graphify/__main__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/graphify/__main__.py b/graphify/__main__.py index 62efefecf..9c60fd574 100644 --- a/graphify/__main__.py +++ b/graphify/__main__.py @@ -2428,14 +2428,11 @@ def main() -> None: # "Community N" (#1097). Degrades to placeholders if no backend/on error. from graphify.llm import generate_community_labels print("Labeling communities...") - labels, _label_src = generate_community_labels( + # The final labels (LLM or placeholder fallback) are persisted to + # .graphify_labels.json by the unconditional write below. + labels, _ = generate_community_labels( G, communities, backend=label_backend, gods=gods ) - if _label_src == "llm": - labels_path.write_text( - json.dumps({str(k): v for k, v in labels.items()}, ensure_ascii=False), - encoding="utf-8", - ) questions = suggest_questions(G, communities, labels) tokens = {"input": 0, "output": 0} from graphify.export import _git_head as _gh