question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 💯 !

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:71 (56 by maintainers)

github_iconTop GitHub Comments

1reaction
Saad135commented, Nov 16, 2022

I can take DeformableDetrConfig next

1reaction
Saad135commented, Nov 5, 2022

I can take DPR next

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing with Spring Boot and @SpringBootTest - Reflectoring
A tutorial on when and how to use Spring Boot's @SpringBootTest annotation and how to reduce test runtime.
Read more >
Configuring a Step - Spring
A simple Step might load data from a file into the database, ... When using Java configuration, you can use the Spring Batch...
Read more >
Control Center Configuration Reference
For a list of sample configuration files, see Control Center Properties File. ... Auto create a trigger and an email action for Control...
Read more >
Test Class | Apex Reference Guide - Salesforce Developers
The enableChangeDataCapture() method ensures that Apex tests can fire change event triggers regardless of the entities selected in Setup in the Change Data ......
Read more >
Testing apps locally with the emulator | Cloud Pub/Sub ...
To develop and test your application locally, you can use the Pub/Sub emulator, ... This configuration connects you application to the emulator.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found