You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for having looked into this. I've been suspicious of these \n's in llama.cpp since I noticed that when I added \n\n for llama 3's prompt, the Continuation would usually add a third one at the start of the reply for no obvious reason. What you're finding it probably the reason for that.
Activity
danielhanchen commentedon May 6, 2024
Update:
Hi so I managed to test HF -> llama.cpp without Unsloth to remove Unsloth from the picture.
tokenizer.batch_decode([1734])returns\\n.llama.cppis tokenizing\n\nas\\n\\n.\\n= 1734\n= 198\n\n= 271\n\n\n= 14324*
\n= 10385*
\n= 149636*
\n= 52447*
\n= 356838*
\n= 60879*
\n= 55160I used
!python llama.cpp/convert-hf-to-gguf.py ./model --outfile ./model.f16.gguf --outtype f16then!./llama.cpp/main -m ./model.f16.gguf -n 1024 --temp 0.0 --verbose-prompt --check-tensors \ -p "<|start_header_id|>user<|end_header_id|>\n\n!!llama.cpp!!<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"See reproducible notebook: https://colab.research.google.com/drive/1aNS8CgXoJZHclBEW3ZjFfiLjpmqZ14KN?usp=sharing
Below is the comparison of tokenization differences between llama.cpp and HF:

I also used
convert.pywhich I'm assuming is not anyways supposed to work (maybe). I chose--vocab-type bpe. Reproducible example: https://colab.research.google.com/drive/1X8XBdLRf1-eRDSfcr_GrIhaf84Wp9FH1?usp=sharingSadly

convert.pyis even worse, splitting the newlines into 2 distinct characters:araleza commentedon May 6, 2024
Thanks for having looked into this. I've been suspicious of these
\n's in llama.cpp since I noticed that when I added \n\n for llama 3's prompt, the Continuation would usually add a third one at the start of the reply for no obvious reason. What you're finding it probably the reason for that.danielhanchen commentedon May 10, 2024
It should be fixed!
ci(version-compat): expand TRL coverage + add transformers + PEFT extras