-
Notifications
You must be signed in to change notification settings - Fork 9.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
fixes infill incorrect tokenization #3508
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dfeda32
infill tokens correction
vvhg1 8bd24b2
Merge branch 'ggerganov:master' into master
vvhg1 6796e74
serverinfill tokens correction
vvhg1 377be2f
removing any leading whitespace from infill suffix and removing leead…
vvhg1 b4046aa
removing any leading whitespace from infill suffix and removing leead…
vvhg1 0526560
only rm when params.escape, rm space if possible which is added back …
vvhg1 63ba0b6
only rm when params.escape, rm space if possible which is added back …
vvhg1 003c15b
Revert "only rm when params.escape, rm space if possible which is add…
vvhg1 fc01dc0
Merge branch 'master' of github.com:ggerganov/llama.cpp
vvhg1 c3a7f84
fix interactive prompt escaping and fix server infill leading space h…
vvhg1 b1b6bef
rm unnecessary bool check
vvhg1 4a21468
Merge branch 'master' of github.com:ggerganov/llama.cpp
vvhg1 d9dae93
Merge branch 'master' of github.com:ggerganov/llama.cpp
vvhg1 141329f
Merge branch 'master' of github.com:ggerganov/llama.cpp
vvhg1 3517729
Merge branch 'master' of github.com:ggerganov/llama.cpp
vvhg1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I could be missing something, but this whole section should not be needed.
If you keep everything else and just replace this block with:
Can you find a case that does not match the Python version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I can find cases where it misbehaves:
with params.escape, if the suffix starts with a space, the tokenizer adds a space and THEN tokenizes the double space to
259
so we can't remove the surplus space anymore but would have to "translate" the259
to29871
to remove the space, same with more than one leading spaces...without params.escape if the suffix starts with a space, we remove it so it does not reflect the original suffix
not sure what the python version does as I can't test it, but the above behaviour seems wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that makes sense. Let's double check, just in case:
@kherud Could you please run the Python codellama with suffix with 2 leading spaces and see what tokens are produced for infill?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.