Skip to content

🔥[Community Event] Doc Tests Sprint - Configuration files🔥 #19487

@ydshieh

Description

@ydshieh

This 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:

  1. Change the import order of the model and configuration classes
  2. Add (with random weights) in the comment before model initialization line
  3. Add configuration_[model_name].py to utils/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:

  1. Stage your changes

    git add src/transformers/models/bert/configuration_bert.py
  2. 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).

  3. Launch the test:

    python -m pytest --doctest-modules src/transformers/models/bert/configuration_bert.py -sv --doctest-continue-on-failure
  4. 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 💯 !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions