Skip to content
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

Return an error when a tensor's name in gguf is long #657

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ReinforcedKnowledge
Copy link

Description

When writing a GGUF file, there are very few checks that are made but that could cause an error when loading and working with it. One of them is having tensor names that are longer than 64 characters.

The name of a tensor when reading tensor information doesn't have a limit of characters on it as we can see here gguf_tensor_info but when later on we work with the GGML tensors we find that there is indeed a limit which can cause an issue when looking up a tensor by its name.

Changes Made

This PR concerns gguf_init_from_file.

@ReinforcedKnowledge
Copy link
Author

This is a very small PR but as I'm trying to write blip2 in C/C++ using on GGML, I find that having an error here would have helped me find the issue with my GGUF file quicker.

src/ggml.c Outdated Show resolved Hide resolved
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants