Skip to content

scripts/strip_vision_weights.py leaves metadata.total_size at the pre-strip value #104

Description

@ahrazzle

Reproduction

Given a safetensors index with vision weights:

  • Index before: total_size = 96
  • After stripping vision keys from weight_map
  • Index after: total_size = 96

The file removes vision keys from weight_map but does not recompute metadata.total_size. The retained tensors total 64, but the index still reports 96.

Impact

Consumers that trust total_size from the index over-report disk usage by the stripped volume (~0.9 GB).

Smallest fix

Recompute idx["metadata"]["total_size"] from the retained tensor offsets before writing the index.

Status (2026-10-03)

Still present on feafe31. The script moved to python/scripts/strip_vision_weights.py in cad29a1 (layout refactor, no logic change). metadata.total_size is never recomputed after stripping.

Automated posting by agentic team with human oversight.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions