-
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
llava-cli outputs gibberish #6944
Comments
This commit does work 8a56075
This one (next commit) makes it output gibberish f4dea7d
|
Alright, so for my use case, I'll stick to commit 8a56075. If anyone needs more information about my Python version, packages, ... provided they can't reproduce it with arbitrary versions, I'll share them Hope this helps someone! |
I can't reproduce. This works on latest make -j && ./llava-cli -m ./models/llava-7b-v1.6/ggml-model-f16.gguf --mmproj ./models/llava-7b-v1.6/mmproj-model-f16.gguf --image ~/Downloads/cat.png -p "What is the animal doing?" --temp 0.0 -ngl 99 @turian Don't think this is related to tokenization changes, since LLaMA 1 and 2, Mistral and Phi-3 all use what we call SPM tokenizer - i.e. no pre-tokenization is done. The tokenization changes only affect models using BPE tokenizer |
@ggerganov Thank you for the explanation, but perhaps I need to open another bug report? I have a colab notebook using TinyLlama-1.1b-1 (SPM according to llama.cpp output) showing that the llama-cpp-python tokenizer gives different output from the HF tokenizer. I am using TheBloke GGUF's which are quite old.
So I'm still seeing that with an old GGUF SPM model that the llama.cpp tokenization is different and bad.
Is this expected and why? |
The issue happened on the latest (928e0b7) commit that day. Can you try that one if you want?
On today's latest commit, it works.
And a previous commit (8a56075) had it working as well. I guess the issue is solved now, although if the source was found it may be useful, to prevent reintroduction in the future. I'm pretty sure it was commit f4dea7d that introduced it. Update: Actually, nevermind and apologies, it does work (even) on the referenced (928e0b7, f4dea7d) commit(s). For some reason (arghhhh), I or some AI tool must have inadvertently removed make -j && from my code base, which messed up the execution after |
@turian You can open another issue, but I just verified that TinyLlama tokenization is correct using latest Here are the steps:
diff --git a/convert-hf-to-gguf-update.py b/convert-hf-to-gguf-update.py
index a26f45a5..4fbec9f1 100755
--- a/convert-hf-to-gguf-update.py
+++ b/convert-hf-to-gguf-update.py
@@ -70,6 +70,7 @@ models = [
{"name": "qwen2", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/Qwen/Qwen1.5-7B", },
{"name": "olmo", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/allenai/OLMo-1.7-7B-hf", },
{"name": "dbrx", "tokt": TOKENIZER_TYPE.BPE, "repo": "https://huggingface.co/databricks/dbrx-base", },
+ {"name": "tinyllama", "tokt": TOKENIZER_TYPE.SPM, "repo": "https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0", },
]
# make directory "models/tokenizers" if it doesn't exist
python3 convert-hf-to-gguf-update.py <hf_token>
python3 convert-hf-to-gguf.py models/tokenizers/tinyllama/ --outfile models/ggml-vocab-tinyllama.gguf --vocab-only
make -j tests && ./tests/test-tokenizer-0 ./models/ggml-vocab-tinyllama.gguf
|
@ggerganov My issue is that an OLD previously converted TinyLlama GGUF a) has buggy tokenization b) doesn't provide any warning. Is there any workaround for getting old GGUF files to work, rather than creating new GGUF files from HF? |
Maybe a version bump every time models break? Could do major.minor.revision and update the minor most of time? Update the major for breaking? |
I am using an M1, on commit 928e0b7.
When I run
./llava-cli -m ./models/llava-v1.6-mistral-7b/ggml-mistral-7b-q_5_k.gguf --mmproj ./models/llava-v1.6-mistral-7b/mmproj-mistral7b-f16-q6_k.gguf -p 'Describe the image.' --image ./models/llava-v1.6-mistral-7b/S.jpg -c 4096
I get:
I also tried with xtuner/llava-phi-3-mini with similar results.
./llava-cli -m ./models/llava-phi-3-mini/ggml-model-f16.gguf --mmproj ./models/llava-phi-3-mini/mmproj-model-f16.gguf -p 'Describe the image.' --image ./models/llava-v1.6-mistral-7b/S.jpg -c 4096
Have there been any breaking changes to the llava-cli command? Can someone reproduce this issue as well?
The text was updated successfully, but these errors were encountered: