Fix 9918#9932
Merged
Merged
Conversation
sgugger
commented
Feb 1, 2021
| (a) For sequence pairs (for a pair title+text for example): | ||
|
|
||
| ``tokens: [CLS] is this jack ##son ##ville ? [SEP] no it is not . [SEP]`` | ||
| :: |
Collaborator
Author
There was a problem hiding this comment.
That docstring had been changed to work around the doc-styling failure. This makes it the same as the PyTorch one,
sgugger
commented
Feb 1, 2021
Comment on lines
+138
to
+144
| def end_of_special_style(self, line): | ||
| """ | ||
| Sets back the `in_block` attribute to `NOT_SPECIAL`. | ||
|
|
||
| Useful for some docstrings where we may have to go back to `ARG_LIST` instead. | ||
| """ | ||
| self.in_block = SpecialBlock.NOT_SPECIAL |
Collaborator
Author
There was a problem hiding this comment.
Basically the problem was that when a code block was nested in the argument list, we were returning to a not special style instead of returning to an arg list style. This new method overriden in the subclass DocStyler ensures we return to the proper type.
LysandreJik
approved these changes
Feb 2, 2021
Member
LysandreJik
left a comment
There was a problem hiding this comment.
Great, thanks for updating all of these! LGTM!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
This PR addresses the problem shown in #9918 by:
encodemethod to thePreTrainedTokenizerandPreTrainedTokenizerFast(it is in all their subclasses already)In passing, I uncovered a failure of the doc styling script on DPR, so this PR also fixes that.
Fixes #9918