-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
pad_token_id of -1 is not understood by convert.py #2981
Comments
@henk717 Your model has an unusual config.json, you may want to look into that. |
I assume To make it work right now you should be able to just delete that line from the JSON file. |
@cebtenzzre my model's config file is a copy of https://huggingface.co/jondurbin/airoboros-33b-gpt4-1.4/blob/main/config.json |
@henk717 This issue should be fixed if you update to |
I converted a copy of Airochronos (a similar merge by henk) from GGML to GGUF using the current code and the --metadata-dir option. With the 'main' example, it seems to render the BOS token as I think the values in config.json are completely wrong, and should actually not be silently accepted. |
There's no special metadata-handling code in the GGML to GGUF converter, it just delegates that part to Or are you saying this only happens with GGML to GGUF but not converting the model from the original files? |
I assume it happens in both cases. I don't think I ever tested the fix with convert.py and Chronoboros because I ended up changing the config.json to have the correct values. I forgot to do that this time, and ran into this issue again. This is how llama.cpp prints the special tokens for this broken version of Airochronos:
|
Do you have a link for the model so I can look at the exact metadata? (I'm definitely not an expert on this so it may or may not help. Most of my interaction with this stuff has just been trying to clean up existing code which didn't really require understanding why stuff was set up the way it was.) |
|
It's also set to null in tokenizer_config.json In this case pad should be set to eos I guess. But I doubt that this is something that we're supposed to handle in convert.py --model convertors should handle such cases themselves. |
Not a full answer, but I remember at some point changing the code to just treat id -1 like the field wasn't set. (Originally it would just crash on that.) |
This model is only compatible with HF transformers because it reads the EOS token string from special_tokens_map.json and then looks up the token in the vocabulary to get the ID. Should we do that, too? Otherwise, I could just revert #2984 and blame the models. |
You probably don't want to just revert it. The original behavior was to just crash when trying to convert the model. If you want to just refuse to convert models like that, more friendly handling with a reasonable error message would be better. |
AFAIK eos_token_id from config.json is not even used outside of warn_if_padding_and_no_attention_mask, so we probably shouldn't use it at all. tokenizer_config.json appears to be the new place for it: |
I tried to convert Chronoboros-33B to GGUF with convert.py (commit 3358c38), and I got this error:
I didn't have this issue when I previously converted the model to GGML.
This only happens because tokenizer.json is not available. For instance, if you apply a LoRA to this model with TheBloke's script, you end up with a model folder that does contain tokenizer.json. Converting this model displays these special tokens instead, and does not fail:
The text was updated successfully, but these errors were encountered: