Skip to content

[E4] fp16_convert over-broad glob deletes sibling models' external weight data #270

Description

@DsThakurRawat

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions