fix: accept 0-indexed safetensors shard names in CI weight validator (#24237)

This commit is contained in:
Alison Shao
2026-05-02 00:58:15 -07:00
committed by GitHub
parent 2e72a36420
commit f3dbadb82b
@@ -1426,7 +1426,10 @@ def _validate_sharded_model(
for group_key, group_info in shard_groups.items():
total_shards = group_info["total"]
found_shards = set(group_info["found_shards"])
expected_shards = set(range(1, total_shards + 1))
# Shards may be 0-indexed (e.g. inclusionAI/Ring-2.5-1T) or 1-indexed
# (e.g. deepseek-ai/DeepSeek-V3); both are valid HF conventions.
min_idx = min(found_shards) if found_shards else 1
expected_shards = set(range(min_idx, min_idx + total_shards))
# Check for missing shards
missing_shards = expected_shards - found_shards