convert-hf : sort model part names

`os.listdir` is said to list files in arbitrary order.
Sorting the file names should let "model-00009-of-00042.safetensors"
be loaded before "model-00010-of-00042.safetensors".
This commit is contained in:
Francis Couture-Harpin 2024-05-01 19:16:59 -04:00
parent 639b374b1a
commit 644c2696d0

View file

@ -243,6 +243,8 @@ class Model(Protocol):
if filename.endswith(suffix): if filename.endswith(suffix):
part_names.append(filename) part_names.append(filename)
part_names.sort()
return part_names return part_names
@staticmethod @staticmethod