Skip to content
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

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

Closed
ydshieh opened this issue Oct 11, 2022 · 81 comments · Fixed by AShreyam/transformers#1, AShreyam/transformers#2, #19722, #19725 or #19724

Comments

@ydshieh
Copy link
Collaborator

ydshieh commented Oct 11, 2022

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

@ydshieh ydshieh changed the title 🔥[Community Event] Another Doc Tests Sprint (for model configuration files)🔥 🔥[Community Event] Another Doc Tests Sprint (for configuration files)🔥 Oct 12, 2022
@ydshieh ydshieh changed the title 🔥[Community Event] Another Doc Tests Sprint (for configuration files)🔥 🔥[Community Event] Doc Tests Sprint - Configuration files🔥 Oct 12, 2022
@daspartho
Copy link
Contributor

I'd like to work on this; I'll start with YOLOS and open a PR :)

@daspartho
Copy link
Contributor

I'll take on Whisper!

@daspartho
Copy link
Contributor

I'll work on Beit!

@imarekkus
Copy link
Contributor

FYI Bart #19524 and Albert #19541 are already done :)

@daspartho
Copy link
Contributor

I'll take on GPT2 next!

@RamitPahwa
Copy link
Contributor

I can take imageGPT

@grgkaran03
Copy link
Contributor

i'll work on yoso

@daspartho
Copy link
Contributor

I'll work on

  • RoBERTa
  • ViT
  • DeiT
  • Reformer

and open up PR soon :)

@RamitPahwa
Copy link
Contributor

Also will raise for Transformer-XL !

@imarekkus
Copy link
Contributor

I'll work on bloom

@sha016
Copy link
Contributor

sha016 commented Oct 28, 2022

I'll take fsmt next

@Saad135
Copy link
Contributor

Saad135 commented Oct 30, 2022

While browsing the list of model configurations, I noticed that the DebertaConfig class does not have an example docstring section. Unsure if that is supposed to be like that, but just incase its not, I will add a PR to include the example docstring and maybe I can get some feedback from there.

@kushal-gopal
Copy link

I'll work on dpt

@ydshieh
Copy link
Collaborator Author

ydshieh commented Oct 31, 2022

DebertaConfig

That would be very nice, @Saad135 ! Thank you

@Saad135
Copy link
Contributor

Saad135 commented Nov 1, 2022

I will take DeBERTa-v2 next

@Saad135
Copy link
Contributor

Saad135 commented Nov 3, 2022

I can take camembert next

@Saad135
Copy link
Contributor

Saad135 commented Nov 5, 2022

I can take DPR next

@Saad135
Copy link
Contributor

Saad135 commented Nov 16, 2022

I can take DeformableDetrConfig next

@JuheonChu
Copy link
Contributor

Can I take timesformer next?

@ydshieh
Copy link
Collaborator Author

ydshieh commented Jan 30, 2023

Can I take timesformer next?

Sure! For the context, we decide not to use the tiny random model checkpoints anymore. If there are some downstream models which lack the checkpoint, we just not to provide the expected values.

@elabongaatuo
Copy link
Contributor

Hello, I would like to take on gptj, longformer, and hubert

@elabongaatuo
Copy link
Contributor

@ydshieh , may I share a list of models that are yet to be worked on?

@ydshieh
Copy link
Collaborator Author

ydshieh commented Apr 12, 2023

@elabongaatuo GPT-J is large, and our CI won't be able to run doctest with its checkpoints.

I think gptj, longformer, and hubert are all covered in

https:/huggingface/transformers/blob/5f3ea66bc0c27ad2a8761fdf8489cf7d72257b93/utils/documentation_tests.txt

Feel free to check the modeling files that are not in the above file 🤗 if you want to work on it ❤️ . Thank you!

@elabongaatuo
Copy link
Contributor

@ydshieh , thank you. m2m_100,llama and mvp don't have modeling files. a go ahead to work on them?

@ydshieh
Copy link
Collaborator Author

ydshieh commented Apr 12, 2023

llama has no publicly available checkpoints on the Hub - no need to work on it.
For the other 2 files, you can run doctest against them. If they pass, you can simply add them to documentation_tests.txt.
Otherwise, we can discuss how to deal with the errors :-).

  • we might need to use a community user's checkpoint
  • or a checkpoint without real weights, and indicate this

@PhalitJotwani
Copy link

Hi @ydshieh , I am new to open source, so just wanted to confirm whether I can take Falcon or not? Config file of Falcon is not mentioned in the documentation_tests.txt file.

@AVAniketh0905
Copy link
Contributor

AVAniketh0905 commented Oct 2, 2023

Hello @ydshieh , I am new to open sorce and want to take barthez. If my contributions are successful, I'm eager to extend my involvement to other models as well. Looking forward to a productive and enduring journey of contributions!

Edit: I couldn't find configuration files for barthez. Any help is appreciated!

@hegdeadithyak
Copy link
Contributor

hegdeadithyak commented Oct 2, 2023

I'll take roformer #26530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment