-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Terminator strings for generate() #28932
Merged
+529
−4
Merged
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
262537f
stash commit (will discard all of this)
Rocketknight1 cfa538b
stash commit
Rocketknight1 127182a
First commit - needs a lot of testing!
Rocketknight1 8cd6059
Add a test
Rocketknight1 5fde7ae
Fix imports and make the tests actually test something
Rocketknight1 ff02b0c
Tests pass!
Rocketknight1 4ce1aba
Rearrange test
Rocketknight1 1742b68
Add comments (but it's still a bit confusing)
Rocketknight1 9fb77e3
Stop storing the tokenizer
Rocketknight1 667d6d8
Comment fixup
Rocketknight1 070a76e
Fix for input_ids with a single sequence
Rocketknight1 4c436f2
Update tests to test single sequences
Rocketknight1 78b0f24
make fixup
Rocketknight1 8ee5762
Fix incorrect use of isin()
Rocketknight1 9f43a2a
Expand tests to catch more cases
Rocketknight1 f0fa707
Expand tests to catch more cases
Rocketknight1 5bcf5e4
make fixup
Rocketknight1 8cca9a4
Fix length calculation and update tests
Rocketknight1 ec6f726
Handle Ġ as a space replacement too
Rocketknight1 0e632c2
Update src/transformers/generation/stopping_criteria.py
Rocketknight1 ac1135c
Add optimizations from Joao's suggestion
Rocketknight1 2731827
Remove TODO
Rocketknight1 9213298
Update src/transformers/generation/stopping_criteria.py
Rocketknight1 f48522e
Update tests/generation/test_stopping_criteria.py
Rocketknight1 7a772b8
make fixup
Rocketknight1 c604a2b
Rename some variables and remove some debugging clauses for clarity
Rocketknight1 7dd346a
Add tests for the sub-methods
Rocketknight1 641ba72
Clarify one test slightly
Rocketknight1 f6721a5
Add stop_strings to GenerationConfig
Rocketknight1 8772bcb
generate() supports stop_string arg, asks for tokenizer if not provided
Rocketknight1 e423417
make fixup
Rocketknight1 398a799
Cleanup code and rename variables for clarity
Rocketknight1 e3140a6
Update tokenizer error
Rocketknight1 0008722
Update tokenizer passing, handle generation on GPU
Rocketknight1 a29c131
Slightly more explanation cleanup
Rocketknight1 9c359ff
More comment cleanup
Rocketknight1 602222d
Factor out the token cleanup so it's more obvious what we're doing, a…
Rocketknight1 4c7a777
Careful with that cleanup!
Rocketknight1 b6e0163
Cleanup + optimizations to _get_matching_positions
Rocketknight1 43d9e08
More minor performance tweaks
Rocketknight1 60eb576
Implement caching and eliminate some expensive ops (startup time: 200…
Rocketknight1 ff42211
Remove the pin_memory call
Rocketknight1 ae800a6
Parallelize across all stop strings!
Rocketknight1 46c0a9c
Quick fix for tensor devices
Rocketknight1 b9a066d
Update embeddings test for the new format
Rocketknight1 692523c
Fix test imports
Rocketknight1 2ba7f8e
Manual patching for BERT-like tokenizers
Rocketknight1 8b95ec1
Return a bool vector instead of a single True/False
Rocketknight1 1b46b20
Better comment
Rocketknight1 350a850
Better comment
Rocketknight1 0b85c6c
Add tests from @zucchini-nlp
Rocketknight1 e8c769d
Amy's list creation nit
Rocketknight1 14de1c3
tok_list -> token_list
Rocketknight1 b8961e8
Push a big expanded docstring (should we put it somewhere else?)
Rocketknight1 7ed55ad
Expand docstrings
Rocketknight1 cbb9d14
Docstring fixups
Rocketknight1 7db95c1
Rebase
Rocketknight1 49b0f21
make fixup
Rocketknight1 c9aefe6
Make a properly general method for figuring out token strings
Rocketknight1 443cd5d
Fix naming throughout the functions
Rocketknight1 e1c9c0e
Move cache, refactor, fix tests
Rocketknight1 f49ec00
Add comment
Rocketknight1 e90aaba
Remove finished TODO
Rocketknight1 bb27d82
Remove finished TODO
Rocketknight1 4317019
make fixup
Rocketknight1 19df6a8
Update src/transformers/generation/stopping_criteria.py
Rocketknight1 8b52039
Update and shorten docstring
Rocketknight1 0aa201c
Update tests to be shorter/clearer and test specific cases
Rocketknight1 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
Update embeddings test for the new format
- Loading branch information
commit b9a066d34d9d35f7f26c2a72a70bf1a2db6c04da
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
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.
❤️