1. 28 Dec, 2021 1 commit
    • Sylvain Gugger's avatar
      Doc styler examples (#14953) · b5e2b183
      Sylvain Gugger authored
      * Fix bad examples
      
      * Add black formatting to style_doc
      
      * Use first nonempty line
      
      * Put it at the right place
      
      * Don't add spaces to empty lines
      
      * Better templates
      
      * Deal with triple quotes in docstrings
      
      * Result of style_doc
      
      * Enable mdx treatment and fix code examples in MDXs
      
      * Result of doc styler on doc source files
      
      * Last fixes
      
      * Break copy from
      b5e2b183
  2. 27 Dec, 2021 1 commit
    • Sylvain Gugger's avatar
      Doc styler v2 (#14950) · 87e6e4fe
      Sylvain Gugger authored
      * New doc styler
      
      * Fix issue with args at the start
      
      * Code sample fixes
      
      * Style code examples in MDX
      
      * Fix more patterns
      
      * Typo
      
      * Typo
      
      * More patterns
      
      * Do without black for now
      
      * Get more info in error
      
      * Docstring style
      
      * Re-enable check
      
      * Quality
      
      * Fix add_end_docstring decorator
      
      * Fix docstring
      87e6e4fe
  3. 21 Dec, 2021 2 commits
    • Patrick von Platen's avatar
      [Bart] better error message (#14854) · b513ec8b
      Patrick von Platen authored
      b513ec8b
    • Sylvain Gugger's avatar
      Convert docstrings of modeling files (#14850) · 7af80f66
      Sylvain Gugger authored
      * Convert file_utils docstrings to Markdown
      
      * Test on BERT
      
      * Return block indent
      
      * Temporarily disable doc styler
      
      * Remove from quality checks as well
      
      * Remove doc styler mess
      
      * Remove check from circleCI
      
      * Fix typo
      
      * Convert file_utils docstrings to Markdown
      
      * Test on BERT
      
      * Return block indent
      
      * Temporarily disable doc styler
      
      * Remove from quality checks as well
      
      * Remove doc styler mess
      
      * Remove check from circleCI
      
      * Fix typo
      
      * Let's go on all other model files
      
      * Add templates too
      
      * Styling and quality
      7af80f66
  4. 13 Dec, 2021 1 commit
  5. 10 Dec, 2021 1 commit
  6. 18 Nov, 2021 1 commit
  7. 09 Nov, 2021 1 commit
  8. 01 Nov, 2021 1 commit
  9. 29 Oct, 2021 1 commit
  10. 26 Oct, 2021 1 commit
  11. 25 Oct, 2021 1 commit
  12. 15 Oct, 2021 1 commit
  13. 01 Oct, 2021 1 commit
    • Silviu Oprea's avatar
      Bart: check if decoder_inputs_embeds is set (#13800) · 707f7eb1
      Silviu Oprea authored
      
      
      In BartForConditionalGeneration.forward, if labels are provided,
         decoder_input_ids are set to the labels shifted to the right.
         This is problematic: if decoder_inputs_embeds is also set,
         the call to self.model, which eventually gets to BartDecoder.forward,
         will raise an error.
         The fix is quite simple, similar to what is there already in
         BartModel.forward. Mainly, we should not
         compute decoder_input_ids if decoder_inputs_embeds is provided.
      Co-authored-by: default avatarSilviu Vlad Oprea <silviuvo@amazon.co.uk>
      707f7eb1
  14. 24 Sep, 2021 1 commit
    • Tommy Chiang's avatar
      Use torch.unique_consecutive to check same element (#13637) · a2ef9c54
      Tommy Chiang authored
      We use `torch.unique` here only to check whether every elements have
      the same value.
      Therefore, we can use `torch.unique_consecutive` here.
      
      This function eliminates all but the first element from every consecutive
      group of equivalent elements.
      Like, if we apply this function to `[1, 2, 2, 1]`, it will result in
      `[1, 2, 1]`.
      
      As you could see, this is enough for checking whether every elements
      have the same value.
      
      Since `torch.unique_consecutive` do less thing, it is much more faster.
      On my computer, it is 25x faster on GPU and 15x faster on CPU.
      a2ef9c54
  15. 22 Sep, 2021 1 commit
  16. 14 Jun, 2021 1 commit
  17. 07 Jun, 2021 3 commits
  18. 01 Jun, 2021 1 commit
  19. 18 May, 2021 1 commit
    • Daniel Stancl's avatar
      Fix usage of head masks by PT encoder-decoder models' `generate()` function (#11621) · 680d181c
      Daniel Stancl authored
      * Add missing head masking for generate() function
      
      * Add head_mask, decoder_head_mask and cross_attn_head_mask
      into prepare_inputs_for_generation for generate() function
      for multiple encoder-decoder models.
      
      * Add test_genereate_with_head_masking
      
      * [WIP] Update the new test and handle special cases
      
      * make style
      
      * Omit ProphetNet test so far
      
      * make fix-copies
      680d181c
  20. 06 May, 2021 1 commit
  21. 27 Apr, 2021 1 commit
  22. 26 Apr, 2021 1 commit
  23. 23 Apr, 2021 1 commit
    • Daniel Stancl's avatar
      Fix cross-attention head mask for Torch encoder-decoder models (#10605) · e3ff165a
      Daniel Stancl authored
      * Fix cross-attention head mask for Torch BART models
      
      * Fix head masking for cross-attention module for the following
      models: BART, Blenderbot, Blenderbot_small, M2M_100, Marian, MBart,
      Pegasus
      
      * Enable test_headmasking for M2M_100 model
      
      * Fix cross_head_mask for FSMT, LED and T5
      
      * This commit fixes `head_mask` for cross-attention modules
      in the following models: FSMT, LED, T5
      
      * It also contains some smaller changes in doc so that
      it is be perfectly clear the shape of `cross_head_mask`
      is the same as of `decoder_head_mask`
      
      * Update template
      
      * Fix template for BartForCausalLM
      
      * Fix cross_head_mask for Speech2Text models
      
      * Fix cross_head_mask in templates
      
      * Fix args order in BartForCausalLM template
      
      * Fix doc in BART templates
      
      * Make more explicit naming
      
      * `cross_head_mask` -> `cross_attn_head_mask`
      
      * `cross_layer_head_mask` -> `cross_attn_layer_head_mask`
      
      * Fix doc
      
      * make style quality
      
      * Fix speech2text docstring
      e3ff165a
  24. 13 Apr, 2021 1 commit
  25. 07 Apr, 2021 1 commit
  26. 24 Mar, 2021 1 commit
  27. 08 Mar, 2021 1 commit
  28. 05 Mar, 2021 1 commit
    • Daniel Hug's avatar
      Refactoring checkpoint names for multiple models (#10527) · 90ecc296
      Daniel Hug authored
      * Refactor checkpoint name in ALBERT and ALBERT_tf
      
      * Refactor checkpoint name in BART and BART_tf
      
      * Refactor checkpoint name in BERT generation
      
      * Refactor checkpoint name in Blenderbot_tf
      
      * Refactor checkpoint name in Blenderbot_small_tf
      
      * Refactor checkpoint name in ConvBERT AND CONVBERT_TF
      
      * Refactor checkpoint name in CTRL AND CTRL_TF
      
      * Refactor checkpoint name in DistilBERT AND DistilBERT_TF
      
      * Refactor checkpoint name in DistilBERT redo
      
      * Refactor checkpoint name in Electra and Electra_tf
      
      * Refactor checkpoint name in FlauBERT and FlauBERT_tf
      
      * Refactor checkpoint name in FSMT
      
      * Refactor checkpoint name in GPT2 and GPT2_tf
      
      * Refactor checkpoint name in IBERT
      
      * Refactor checkpoint name in LED and LED_tf
      
      * Refactor checkpoint name in Longformer and Longformer_tf
      
      * Refactor checkpoint name in Lxmert and Lxmert_tf
      
      * Refactor checkpoint name in Marian_tf
      
      * Refactor checkpoint name in MBART and MBART_tf
      
      * Refactor checkpoint name in MobileBERT and MobileBERT_tf
      
      * Refactor checkpoint name in mpnet and mpnet_tf
      
      * Refactor checkpoint name in openai and openai_tf
      
      * Refactor checkpoint name in pegasus_tf
      
      * Refactor checkpoint name in reformer
      
      * Refactor checkpoint name in Roberta and Roberta_tf
      
      * Refactor checkpoint name in SqueezeBert
      
      * Refactor checkpoint name in Transformer_xl and Transformer_xl_tf
      
      * Refactor checkpoint name in XLM and XLM_tf
      
      * Refactor checkpoint name in XLNET and XLNET_tf
      
      * Refactor checkpoint name in BERT_tf
      
      * run make tests, style, quality, fixup
      90ecc296
  29. 03 Mar, 2021 1 commit
  30. 25 Feb, 2021 1 commit
    • mingruimingrui's avatar
      Bugfix: Removal of padding_idx in BartLearnedPositionalEmbedding (#10200) · 894db670
      mingruimingrui authored
      
      
      * Assumption of padding_idx <2 might not stand
      
      * Use offset instead of 2
      
      * Fix with black
      
      * Change behavior to warning instead for backward compatibility.
      
      * Fix with black
      
      * Remove warning
      
      * Make padding_idx non-required
      
      * padding_idx fix for blenderbot
      
      * padding_idx fix for blenderbot_small
      
      * padding_idx fix for led
      
      * padding_idx fix for mbart
      
      * Remove extra whitespaces
      
      * padding_idx fix for template
      
      * Fix padding_idx passed to nn.Embedding mistake
      
      * Fixed padding_idx passed to positional embedding in template
      
      * Remove padding_idx from pytorch learned positional embeddings
      
      * Remove accidentally added quotes
      
      * Remove padding_idx from tf learned positional embeddings
      
      * Remove zeroing of weights in __init__
      Co-authored-by: default avatarWang Ming Rui <mingrui.wang@C02CJTUYMD6M.local>
      894db670
  31. 10 Feb, 2021 1 commit
    • Suraj Patil's avatar
      remove adjust_logits_during_generation method (#10087) · c130e67d
      Suraj Patil authored
      * add forced logits processors
      
      * delete adjust_logits method
      
      * add forced_eos_token_id argument in config
      
      * add tests for forced logits processors
      
      * update gen utils tests
      
      * add forced option to tf generate
      
      * remove adjust_logits method from tf models
      
      * update adjust_logits for marian
      
      * delete _force_token_id_to_be_generated method
      
      * style
      
      * import warnings
      
      * pass max_length to _get_logits_processor
      
      * set forced_eos_token_id to None
      
      * set forced attributes in conf utils
      
      * typo
      
      * fix rag generate
      
      * add forced_eos_token_id in rag config
      
      * remove force_bos_token_to_be_generated from BartConfig
      
      * remove _force_token_ids_generation from FSMT
      
      * nit
      
      * fix negative constant
      
      * apply suggestions from code review
      c130e67d
  32. 05 Feb, 2021 1 commit
    • Suraj Patil's avatar
      [examples/seq2seq] support label smoothing (#9844) · 1cd16512
      Suraj Patil authored
      * add prepare_decoder_input_ids_from_labels in s2s models
      
      * support lbl smoothing and enc/emb freezing
      
      * fix freezing
      
      * use pad_token_id from config
      
      * remove embed freezing and add warning
      
      * prepare decoder_input_ids inside DataCollatorForSeq2Seq
      1cd16512
  33. 04 Feb, 2021 2 commits
    • Lysandre Debut's avatar
      Fix model templates (#9999) · e89c959a
      Lysandre Debut authored
      e89c959a
    • demSd's avatar
      BartForCausalLM analogs to `ProphetNetForCausalLM` (#9128) · 00031785
      demSd authored
      
      
      * initiliaze bart4causalLM
      
      * create BartDecoderWrapper, setters/getters
      
      * delete spaces
      
      * forward and additional methods
      
      * update cache function, loss function, remove ngram* params in data class.
      
      * add bartcausallm, bartdecoder testing
      
      * correct bart for causal lm
      
      * remove at
      
      * add mbart as well
      
      * up
      
      * fix typo
      
      * up
      
      * correct
      
      * add pegasusforcausallm
      
      * add blenderbotforcausallm
      
      * add blenderbotsmallforcausallm
      
      * add marianforcausallm
      
      * add test for MarianForCausalLM
      
      * add Pegasus test
      
      * add BlenderbotSmall test
      
      * add blenderbot test
      
      * fix a fail
      
      * fix an import fail
      
      * a fix
      
      * fix
      
      * Update modeling_pegasus.py
      
      * fix models
      
      * fix inputs_embeds setting getter
      
      * adapt tests
      
      * correct repo utils check
      
      * finish test improvement
      
      * fix tf models as well
      
      * make style
      
      * make fix-copies
      
      * fix copies
      
      * run all tests
      
      * last changes
      
      * fix all tests
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      00031785
  34. 19 Jan, 2021 2 commits
  35. 18 Jan, 2021 1 commit