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

[s2s] add support for overriding config params #6149

Merged
merged 6 commits into from
Jul 30, 2020

Conversation

stas00
Copy link
Contributor

@stas00 stas00 commented Jul 30, 2020

add support for overriding model params:

python finetune.py --encoder_layerdrop 0.1 --decoder_layerdrop 0.1 --dropout 0.1 --attention_dropout 0.1

as requested at #6018

README.md seems to be mostly the editor removing superfluous whitespace - not sure why github shows it - normally it doesn't. The only added doc section is https://github.com/stas00/transformers/blob/seq2seq-train_params-1/examples/seq2seq/README.md#finetuning-training-params

@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #6149 into master will increase coverage by 1.32%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6149      +/-   ##
==========================================
+ Coverage   78.35%   79.68%   +1.32%     
==========================================
  Files         146      146              
  Lines       26403    26403              
==========================================
+ Hits        20689    21039     +350     
+ Misses       5714     5364     -350     
Impacted Files Coverage Δ
src/transformers/modeling_tf_flaubert.py 24.22% <0.00%> (-63.98%) ⬇️
src/transformers/tokenization_bart.py 60.56% <0.00%> (-35.22%) ⬇️
src/transformers/modeling_tf_gpt2.py 65.42% <0.00%> (-29.91%) ⬇️
src/transformers/generation_tf_utils.py 85.71% <0.00%> (-0.51%) ⬇️
src/transformers/file_utils.py 82.20% <0.00%> (-0.29%) ⬇️
src/transformers/modeling_tf_distilbert.py 98.79% <0.00%> (+34.61%) ⬆️
src/transformers/modeling_tf_mobilebert.py 96.77% <0.00%> (+73.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54f9fbe...5476a9e. Read the comment docs.

- optional
- goes into model.config
Copy link
Contributor

@sshleifer sshleifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add test cases:

  • good case where model.config has the new value
  • case (T5) that hits your assert. its called dropout_rate in t5. We can expose that or leave it for future work.

I'm surprised you didn't need to change the CHEAP_ARGS constant in the tests.

@sshleifer
Copy link
Contributor

The code looks perfect.

@stas00 stas00 changed the title add support for overriding model params [WIP] add support for overriding model params Jul 30, 2020
@stas00
Copy link
Contributor Author

stas00 commented Jul 30, 2020

I'm surprised you didn't need to change the CHEAP_ARGS constant in the tests.

because the new args are optional? Unless you mean something else.

...Working on the tests.

@stas00
Copy link
Contributor Author

stas00 commented Jul 30, 2020

Added tests as suggested.

@sshleifer sshleifer changed the title [WIP] add support for overriding model params [s2s] add support for overriding config params Jul 30, 2020
@sshleifer
Copy link
Contributor

sshleifer commented Jul 30, 2020

good alias

sty () {
	make style
	flake8 examples templates tests src utils
}

@sshleifer sshleifer merged commit 3212b88 into huggingface:master Jul 30, 2020
@stas00 stas00 deleted the seq2seq-train_params-1 branch July 30, 2020 06:24
stas00 added a commit to stas00/transformers that referenced this pull request Aug 1, 2020
this is a follow up to huggingface#6149
- there was no need to add newly added options to finetune.sh - reverted that change
- added a hint to users how to get all the options (--help)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants