[E4] `fp16_convert` over-broad glob deletes sibling models' external weight data
Labels: bug, export, data-loss, priority:medium
File: src/tether/exporters/fp16_convert.py:211-214
Description. Before saving, it runs for pat in ("*.bin","*.data"): for old in dst.parent.glob(pat): old.unlink() — deleting every .bin/.data in the directory, not just {dst.stem}.*.
Why it matters. Point the converter at a decomposed export dir (holding vlm_prefix.onnx.data + expert_denoise.onnx.data) and converting one silently deletes the other's external weights, leaving that ONNX unloadable. Latent today only because callers use isolated dirs.
Tasks.
- [ ] Restrict unlink to
dst.parent.glob(f"{dst.stem}.*")filtered to.bin/.data.
Dedup. PR #226 scopes fp16 external-data cleanup for another path — confirm overlap, but this specific glob in fp16_convert.py is a separate call site. Cross-check #226's diff before filing.
Completed by PR #226 at 383fa24c6f1a5e3476490a70f6705bc8a07ef927. The FP16 cleanup now deletes only stale .bin/.data files prefixed by the current destination model stem, never the destination itself or sibling models' external data. Five focused regressions cover current-model cleanup, legacy variants, sibling preservation, destination preservation, and clean-directory no-op; the merged CI was green.