-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
[DOCS] Add descriptive docstring to MinNewTokensLength #25196
Merged
sgugger
merged 9 commits into
huggingface:main
from
nablabits:feature/24783-add-examples-for-min-new-tokens-processor
Aug 8, 2023
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ecf8d49
Add descriptive docstring to MinNewTokensLength
nablabits be6da55
Merge branch 'main' into feature/24783-add-examples-for-min-new-token…
nablabits 465a9a8
Refine the differences between `min_length` and `min_new_tokens`
nablabits 32d2e4f
Remove extra line
nablabits c715a61
Remove extra arguments in generate
nablabits f6ac422
Add a missing space
nablabits 2cadec3
Run the linter
nablabits 3ddd58c
Add clarification comments
nablabits 4819454
Merge branch 'main' into feature/24783-add-examples-for-min-new-token…
nablabits 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
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.
Could we use a different input string e.g. "Hugging Face is"?
The examples are a bit confusing because of
"Company"
being in the input and then"company"
being set as the eos tokenThere 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.
Ahh, yes that makes sense, good catch ✨
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.
Hi @amyeroberts I've been trying several prompts to no luck. I'm finding kind of hard getting two instances of the same token when one buries the first occurrence like in the 3rd example (blame my lack of experience 😅). My guess is that
Company
is promotingcompany
somehow. The workaround I found is to use a couple ofeos_token_ids
which has some educational value on its own. This is what happens for the promptHugging Face Inc. is
:eos_token_ids=1664, min_new_tokens=1
: Hugging Face Inc. is a companyeos_token_ids=[1664, 9856], min_new_tokens=2
: Hugging Face Inc. is a non-profit organization that provides educationaleos_token_ids=[1664, 9856], min_new_tokens=10
: Hugging Face Inc. is a non-profit organization that provides free, open source software to theI'm happy to go with above examples, but I kind of like the existing ones as they only involve the change in one parameter, ie, the
min_new_tokens
so it's more like a RCT. In that case, what we can do is to clarfy this comment:To something like:
Let me know what you think 🙂
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.
Updated comment clarifying what's happening sounds good to me!
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.
Nice, thanks for your patience 🙏