Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See e.g #2894 and #2868
In all of these cases, there is a
vocab_size
inconfig.json
with the correct size, buttokenizer.json
has an incorrect amount of tokens compared to the vocab size. Later on, the inference is expecting a tensor withvocab_size
as one of its dimensions but gets<actual count of tokens>
instead.At least in the case of #2894, there is some configuration for an extra 'pad' token which makes up the difference (we are only missing a single token). However for #2868, the difference is much larger and I wasn't able to figure out where those tokens were supposed to come from.
In both cases, this fix was able to produce a gguf which doesn't run into that mismatch issue later on. That's because we already have some logic to introduce pad tokens if the ID is not found: https://github.com/ggerganov/llama.cpp/blob/71d6975559acfd6c8407a4ef8275a9979c737765/convert-falcon-hf-to-gguf.py#L155-L157