todo for layer-independent parameters in get_allow_patterns

This commit is contained in:
Alex Cheema
2025-11-27 19:26:02 +00:00
parent 20d73e90cd
commit b43d30563d
@@ -105,6 +105,9 @@ def get_allow_patterns(weight_map: dict[str, str], shard: ShardMetadata) -> list
):
shard_specific_patterns.add(filename)
sorted_file_names = sorted(weight_map.values())
# TODO: if the model needs any "layer-independent" parameters,
# we might want to always add files that correspond to them
# e.g. lm_head
if shard.is_first_layer:
shard_specific_patterns.add(sorted_file_names[0])
elif shard.is_last_layer: