Skip to content

Commit 644c269

Browse files
committed
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".
1 parent 639b374 commit 644c269

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

convert-hf-to-gguf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ def get_model_part_names(dir_model: Path, suffix: str) -> list[str]:
243243
if filename.endswith(suffix):
244244
part_names.append(filename)
245245

246+
part_names.sort()
247+
246248
return part_names
247249

248250
@staticmethod

0 commit comments

Comments
 (0)