Update special token handling for new llama.cpp API #1105
Merged
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.
Guidance currently uses the now deprecated
llama_token_get_text
, this PR updates it to use 'llama_vocab_get_text` instead. I think the functionality is completely equivalent.Deprecation change is suggested here: https://github.com/ggerganov/llama.cpp/blob/5783575c9d99c4d9370495800663aa5397ceb0be/include/llama.h#L962
Support for DeepSeek models requires an upgrade to
llama-cpp-python==0.3.7
, under whichguidance==0.2.0
throws either aBus Error
orSegmentation Fault
atguidance/guidance/models/llama_cpp/_llama_cpp.py
Line 78 in aa9da9d
I've not been able to run all tests, but I did run
python -m pytest --selected_model llamacpp_phi3_mini_4k_instruct_cpu ./tests -k llama_cpp
for which all the 28 selected tests passed. The same tests fail with the bus error on aa9da9d