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

Encoder decoder config docs #6195

Merged

Conversation

afcruzs
Copy link
Contributor

@afcruzs afcruzs commented Aug 2, 2020

As discussed on #5826, this PR adds more details on how to load encoder/decoder config objects from pretrained folders and how to instantiate encoder_decoder pretrained models given their corresponding configuration objects (useful for loading pre-trained models and modifying some config members for fine-tuning).

@codecov
Copy link

codecov bot commented Aug 2, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6195      +/-   ##
==========================================
+ Coverage   79.47%   79.80%   +0.32%     
==========================================
  Files         146      146              
  Lines       26607    26607              
==========================================
+ Hits        21146    21233      +87     
+ Misses       5461     5374      -87     
Impacted Files Coverage Δ
src/transformers/configuration_encoder_decoder.py 100.00% <ø> (ø)
src/transformers/modeling_encoder_decoder.py 92.20% <ø> (ø)
src/transformers/modeling_tf_flaubert.py 24.22% <0.00%> (-63.98%) ⬇️
src/transformers/tokenization_xlm_roberta.py 84.52% <0.00%> (-10.72%) ⬇️
src/transformers/tokenization_xlnet.py 90.09% <0.00%> (+23.42%) ⬆️
src/transformers/tokenization_marian.py 93.80% <0.00%> (+25.66%) ⬆️
src/transformers/modeling_tf_distilbert.py 98.79% <0.00%> (+34.61%) ⬆️

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 d8dbf3b...4a03156. Read the comment docs.

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Example of the model can be simplified => no need to set decoder = True, since this is done automatically.

src/transformers/modeling_encoder_decoder.py Outdated Show resolved Hide resolved
src/transformers/modeling_encoder_decoder.py Outdated Show resolved Hide resolved
src/transformers/modeling_encoder_decoder.py Outdated Show resolved Hide resolved
model file should only show examples for how to load save model
@patrickvonplaten
Copy link
Contributor

@afcruzs - thanks a lot for your PR. I changed the examples a bit trying to make sure:

  1. Examples in config only concern the EncoderDecoderConfig
  2. Examples in model only concern the EncoderDecoderModel

sorry for meddling in your PR.

@afcruzs
Copy link
Contributor Author

afcruzs commented Aug 4, 2020

Thanks for improving the examples! I've fixed the whitespace issue

@patrickvonplaten patrickvonplaten merged commit 7ea9b2d into huggingface:master Aug 4, 2020
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