🔥[Community Event] Doc Tests Sprint - Configuration files🔥
See original GitHub issueThis sprint is similar to #16292 - but for model configuration files, i.e. configuration_[model_name].py
.
For example, src/transformers/models/bert/configuration_bert.py
The expected changes
The changes we expect could be find #19485:
- Change the import order of the model and configuration classes
- Add
(with random weights)
in the comment before model initialization line - Add
configuration_[model_name].py
toutils/documentation_tests.txt
(respecting the order)
Please do step 3. only after Running the doctest and make sure all tests pass (see below) 🙏
How to run doctests
Suppose you are working on src/transformers/models/bert/configuration_bert.py
. The steps to run the test are:
-
Stage your changes
git add src/transformers/models/bert/configuration_bert.py
-
Prepare the files to be tested
python utils/prepare_for_doc_test.py src
or if you prefer to be more specific
python utils/prepare_for_doc_test.py src/transformers/models/bert/configuration_bert.py
This will change some files (doc-testing needs to add additional lines that we don’t include in the doc source files).
-
Launch the test:
python -m pytest --doctest-modules src/transformers/models/bert/configuration_bert.py -sv --doctest-continue-on-failure
-
Cleanup git status
git checkout -- .
to clean up the changes in step 1.
Ready (or not)?
If all tests pass, you can commit, push and open a PR 🔥 🚀 , otherwise iterate the above steps 💯 !
Issue Analytics
- State:
- Created a year ago
- Comments:71 (56 by maintainers)
Top GitHub Comments
I can take DeformableDetrConfig next
I can take DPR next