-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
EOT token incorrectly set for Mistral-v0.2 trained with added ChatML tokens #7271
Comments
It appears your model does not list If you're able, then maybe try adjusting the necessary special tokens to |
That wouldn't explain this though.
My model also was not trained with those tokens set as special, so I shouldn't need to change that to get things to work. |
The link to your model is 404 not found. Anyway, did you check if |
Sorry, I unprivated it.
My model is fine, and the {
"<|im_end|>": 32001,
"<|im_start|>": 32000
} from transformers import AutoTokenizer
import requests
string_to_test = "<|im_start|>user\nTest Input<|im_end|><|im_start|>assistant\nTest Response<|im_end|>"
tokenizer = AutoTokenizer.from_pretrained("PJMixers/MV02-PB-Mixture-v1-run_15-SFT-7B-Latest-QLoRA")
# Model is converted and quantized with lcpp, running on the latest kcpp
koboldcpp_string_to_test = (
requests.post(
f"http://127.0.0.1:5001/api/extra/tokencount",
json={"prompt": string_to_test},
).json()["ids"]
)
# Transformers output (Correct)
print(tokenizer.encode(string_to_test))
# [1, 32000, 2188, 13, 1963, 11232, 32001, 32000, 13892, 13, 1963, 12107, 32001]
# ['<s>', '<|im_start|>', '▁user', '<0x0A>', 'Test', '▁Input', '<|im_end|>', '<|im_start|>', '▁assistant', '<0x0A>', 'Test', '▁Response', '<|im_end|>']
# KoboldCPP/llama.cpp output (Very incorrect)
print(koboldcpp_string_to_test)
# [1, 32001, 1838, 13, 1963, 11232, 32000, 32001, 489, 11143, 13, 1963, 12107, 32000]
# ['<s>', '<|im_end|>', 'user', '<0x0A>', 'Test', '▁Input', '<|im_start|>', '<|im_end|>', 'ass', 'isstant', '<0x0A>', 'Test', '▁Response', '<|im_start|>'] |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
It's setting the EOT to 32000 and saying that 32000 is
<|im_end|>
, but it's not that for my model. My tokenizer_config.json shows that 32000 is<|im_start|>
, which is how I trained it. This also seems to be causing my model to end responses with<|im_start|>
instead of<|im_end|>
.I converted using
python3 convert-hf-to-gguf.py --outtype bf16 --outfile "./ggml-model-bf16.gguf" "./MyModelDir"
, then quantized usingquantize "./ggml-model-bf16.gguf" "./MyModel-q6_K.gguf" "q6_K"
Link to the model's QLoRA if it matters.
It's like it's hardcoded to set
<|im_start|>
to 32001 and<|im_end|>
to 32000 even if that's not what the model uses.The text was updated successfully, but these errors were encountered: