[DocString] Support a revision in the docstring add_code_sample_docstrings to facilitate integrations#27645
Merged
ArthurZucker merged 11 commits intomainfrom Nov 24, 2023
Merged
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
5 tasks
vvvm23
reviewed
Nov 23, 2023
Contributor
vvvm23
left a comment
There was a problem hiding this comment.
my turn to review I guess 😅
Collaborator
Author
|
Thanks for the review but a PR in draft mode means it's a draft 😉 |
Co-authored-by: Alex McKinney <44398246+vvvm23@users.noreply.github.com>
Contributor
|
oh no 😓 missed the draft status somehow |
Collaborator
Author
|
No worries 🤗 |
amyeroberts
approved these changes
Nov 23, 2023
Comment on lines
+1153
to
+1155
| built_doc = built_doc.replace( | ||
| f'from_pretrained("{checkpoint}")', f'from_pretrained("{checkpoint}", revision="{revision}")' | ||
| ) |
Contributor
There was a problem hiding this comment.
Won't this replace for both the model and any processor classes?
Collaborator
Author
There was a problem hiding this comment.
yep. In case a pr update the tokenizer / processor as well. Even if they are not updated they should still be usable!
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?
When PRs on the hub are not merged yet + sometimes for safety reasons we can pin a revision in the docstring code samples added.
Seems like the CI is enough to test, dummy testing the build with a flax t5 model 😉
Example: https://moon-ci-docs.huggingface.co/docs/transformers/pr_27645/en/model_doc/albert#transformers.FlaxAlbertForMaskedLM.__call__.example