-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Add a check regarding the number of occurrences of ``` #18389
Add a check regarding the number of occurrences of ``` #18389
Conversation
@@ -92,6 +92,9 @@ def process_doc_file(code_file, add_new_line=True): | |||
|
|||
# fmt: off | |||
splits = code.split("```") | |||
if len(splits) % 2 != 1: | |||
raise ValueError("The number of occurrences of ``` should be an even number.") |
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.
Even number doesn't guarantee the correctness, but odd number definitely means something is 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.
(well, at least for almost all the cases in our model and doc files)
The documentation is not available anymore as the PR was closed or merged. |
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.
Thanks for fixing all of those!
…8389) Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
What does this PR do?
We have
TFOPTForCausalLM
doctest failed due to the wrong expected value. The fileprepare_for_doc_test.py
didn't change that model file. It comes from the existence of ``decoder_input_ids```.This PR adds a check, and also fixes all problematic places found with this new check.