Skip to content

py: add_array() will not add to kv store if value is an empty array #8774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mofosyne
Copy link
Collaborator

Problem in #8769 replicated and traced to add_array() adding an empty array to be written to kv store. We don't allow empty array in kv metadata store.

@github-actions github-actions bot added the python python script changes label Jul 30, 2024
@mofosyne mofosyne added bugfix fixes an issue or bug Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix labels Jul 30, 2024
@mofosyne mofosyne force-pushed the 8769-bug-valueerror-invalid-gguf-metadata-value-type-or-value-due-to-missing-tags-in-the-model-card branch from 6ad1fdb to 02665ba Compare July 30, 2024 14:28
I was wondering if there was a specific reason for `if val` but good to hear we can safely use `len(val == 0`

Co-authored-by: compilade <[email protected]>
@mofosyne mofosyne added the merge ready indicates that this may be ready to merge soon and is just holding out in case of objections label Jul 30, 2024
@mofosyne
Copy link
Collaborator Author

mofosyne commented Jul 30, 2024

Happy for any maintainers to press merge if all checks passes and they don't spot anything. (The force push was to remove f-string marker that was caught by flake8)

@mofosyne mofosyne merged commit 7e72aa7 into ggml-org:master Jul 30, 2024
8 checks passed
@mofosyne mofosyne deleted the 8769-bug-valueerror-invalid-gguf-metadata-value-type-or-value-due-to-missing-tags-in-the-model-card branch July 30, 2024 14:57
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Aug 2, 2024
…gml-org#8774)

* gguf_writer.py: add_array() should not add to kv store if empty

* Apply suggestions from code review

I was wondering if there was a specific reason for `if val` but good to hear we can safely use `len(val == 0`

Co-authored-by: compilade <[email protected]>

---------

Co-authored-by: compilade <[email protected]>
mccoylstevens pushed a commit to mccoylstevens/llama.cpp that referenced this pull request May 15, 2025
…gml-org#8774)

* gguf_writer.py: add_array() should not add to kv store if empty

* Apply suggestions from code review

I was wondering if there was a specific reason for `if val` but good to hear we can safely use `len(val == 0`

Co-authored-by: compilade <[email protected]>

---------

Co-authored-by: compilade <[email protected]>
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 indicates that this may be ready to merge soon and is just holding out in case of objections 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.

2 participants