Skip to content

convert : identify missing model files#9397

Merged
ggerganov merged 1 commit intoggml-org:masterfrom
compilade:compilade/convert-check-index
Sep 16, 2024
Merged

convert : identify missing model files#9397
ggerganov merged 1 commit intoggml-org:masterfrom
compilade:compilade/convert-check-index

Conversation

@compilade
Copy link
Copy Markdown
Collaborator

Should fix #9245.

Previously, when models files (like model-00002-of-00002.safetensors) were missing, a cryptic error message was output, but not when only one model file was left.

convert_hf_to_gguf.py now reads the appropriate (model.safetensors|pytorch_model.bin).index.json when it exists instead of only when there are more than one model file.

I've also made the error message easier to understand by making it include a list of missing tensor files instead of the missing tensor names, when that information can be obtained from the index files.

This can be tested with python3 convert_hf_to_gguf.py --dry-run /path/to/model_dir by renaming the model files of multi-part models so that at least one of them doesn't match model*.safetensors or pytorch_model*.bin.

From my testing this seems to work correctly, and should proceed with conversion as before when all the tensors are present or if the index file is missing.

@mesibo Does this help with the problem you've noticed?


@compilade compilade added bugfix fixes an issue or bug python python script changes Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix labels Sep 10, 2024
@mesibo
Copy link
Copy Markdown

mesibo commented Sep 10, 2024

Thanks, it should, I will test it out.

Do you think the script should also validate the part sequence number for continuity, even if an index file is missing? For instance, should it throw an error or exit if seq != prev_seq + 1?

@compilade compilade added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Sep 14, 2024
@ggerganov ggerganov merged commit d54c21d into ggml-org:master Sep 16, 2024
dsx1986 pushed a commit to dsx1986/llama.cpp that referenced this pull request Oct 29, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
Nexesenex pushed a commit to Nexesenex/croco.cpp that referenced this pull request Feb 25, 2025
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fixes an issue or bug merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. python python script changes Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Missing Sanity Check in convert_hf_to_gguf.py

3 participants