Raise error when missing or incorrect dates #42610
Open
+146
−47
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?
Running
utils/add_dates.pyinrepo-consistencycheck doesn't raise errors, so missing dates are not correctly signaled. This PR checks all model cards and raise an error if any of them is missing a date string (very fast). Also checks if some transformers release dates are wrong (much slower, but only checks models included in the git diff inrepo-consistency). Note that the command inrepo-consistencyonly check for problems and explicitly tells contributors what command to run to fix the issues, but doesn't fix the model cards automatically.The PR also adds a command in fix-copies to fix the errors on model cards included in the git diff.
Hopefully with that, we'll always have correct transformers release dates, and no model will be released without a transformers release date in its model card.
As a reminder, these dates are used in this space, which is included in the docs, so it would be nice to keep it accurate and up-to-date.