1. 30 Apr, 2021 8 commits
    • Nicolas Patry's avatar
      Adding `AutomaticSpeechRecognitionPipeline`. (#11337) · db9dd09c
      Nicolas Patry authored
      
      
      * Adding `AutomaticSpeechRecognitionPipeline`.
      
      - Because we added everything to enable this pipeline, we probably
      should add it to `transformers`.
      - This PR tries to limit the scope and focuses only on the pipeline part
      (what should go in, and out).
      - The tests are very specific for S2T and Wav2vec2 to make sure both
      architectures are supported by the pipeline. We don't use the mixin for
      tests right now, because that requires more work in the `pipeline`
      function (will be done in a follow up PR).
      - Unsure about the "helper" function `ffmpeg_read`. It makes a lot of
        sense from a user perspective, it does not add any additional
      dependencies (as in hard dependency, because users can always use their
      own load mechanism). Meanwhile, it feels slightly clunky to have so much
      optional preprocessing.
      - The pipeline is not done to support streaming audio right now.
      
      Future work:
      
      - Add `automatic-speech-recognition` as a `task`. And add the
      FeatureExtractor.from_pretrained within `pipeline` function.
      - Add small models within tests
      - Add the Mixin to tests.
      - Make the logic between ForCTC vs ForConditionalGeneration better.
      
      * Update tests/test_pipelines_automatic_speech_recognition.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Adding docs + main import + type checking + LICENSE.
      
      * Doc style !.
      
      * Fixing TYPE_HINT.
      
      * Specifying waveform shape in the docs.
      
      * Adding asserts + specify in the documentation the shape of the input
      np.ndarray.
      
      * Update src/transformers/pipelines/automatic_speech_recognition.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Adding require to tests + move the `feature_extractor` doc.
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      db9dd09c
    • CeShine Lee's avatar
      T5 Gradient Checkpointing (#11353) · 76116f47
      CeShine Lee authored
      * Implement gradient checkpoinging for T5Stack
      
      * A bit more robust type checking
      
      * Add `gradient_checkpointing` to T5Config
      
      * Formatting
      
      * Set requires_grad only when training
      
      * None return value will only cause problems when training
      
      * Change the output tuple according to `use_cache`
      
      * Enable gradient checkpointing for the decoder
      
      Squashed commit of the following:
      
      commit 658bdd0bd1215353a8770f558bda2ea69a0ad0c7
      Author: Ceshine Lee <shuanck@gmail.com>
      Date:   Sat Apr 24 14:08:17 2021 +0800
      
          Only set `require_grad` for gradient checkpointing
      
      commit acaeee6b2e675045fb28ce2176444c1d63e908bd
      Author: Ceshine Lee <shuanck@gmail.com>
      Date:   Sat Apr 24 13:59:35 2021 +0800
      
          Make gradient checkpointing work with the decoder
      
      * Formatting
      76116f47
    • Manuel Romero's avatar
      Update README.md (#11489) · 58c789e3
      Manuel Romero authored
      Add link to code
      58c789e3
    • Patrick von Platen's avatar
      make style (#11520) · 022a1e9e
      Patrick von Platen authored
      022a1e9e
    • Philip May's avatar
      add sp_model_kwargs to unpickle of xlm roberta tok (#11430) · e0db8276
      Philip May authored
      add test for pickle
      
      simplify test
      
      fix test code style
      
      add missing pickle import
      
      fix test
      
      fix test
      
      fix test
      e0db8276
    • Frederik Bode's avatar
    • Lysandre Debut's avatar
      Pin HuggingFace Hub dependency (#11502) · f37f2adb
      Lysandre Debut authored
      f37f2adb
    • Lysandre's avatar
      Patch notification service · 60d5bda4
      Lysandre authored
      60d5bda4
  2. 29 Apr, 2021 4 commits
  3. 28 Apr, 2021 3 commits
  4. 27 Apr, 2021 3 commits
  5. 26 Apr, 2021 20 commits
  6. 25 Apr, 2021 2 commits
    • cronoik's avatar
      EncoderDecoderConfigs should not create new objects (#11300) · 35cd8eed
      cronoik authored
      
      
      * removes the creation of separate config objects and uses the existing ones instead+overwrite resize_token_embeddings from parent class because it is not working for the EncoderDecoderModel
      
      * rollback to current version of the huggingface master branch
      
      * reworked version that ties the encoder and decoder config of the parent encoderdecoder instance
      
      * overwrite of resize_token_embeddings throws an error now
      
      * review comment suggestion
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * implemented warning in case encoderdecoder is created with differing configs of encoderdecoderconfig and decoderconfig or encoderconfig
      
      * added test to avoid diverging configs of wrapper class and wrapped classes
      
      * Update src/transformers/models/encoder_decoder/modeling_encoder_decoder.py
      
      * make style
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      35cd8eed
    • Daniel Stancl's avatar
      Add head_mask, decoder_head_mask, cross_head_mask to ProphetNet (#9964) · f45cb66b
      Daniel Stancl authored
      * Add head_mask & decoder_head_mask + some corrections
      
      * Fix head masking for N-grams
      
      * Enable test_headmasking for encoder and decod
      
      * Fix one typo regarding in modeling_propgetnet.py
      
      * Enable test_headmasking for ProphetNetStandaloneDecoderModelTest
      and ProphetNetStandaloneEncoderModelTest in test_modeling_prophetnet.py
      
      * make style
      
      * Fix cross_head_mask
      
      * Fix attention head mask naming
      
      * `cross_head_mask` -> `cross_attn_head_mask`
      
      * `cross_layer_head_mask` -> `cross_attn_layer_head_mask`
      
      * Still need to merge #10605 to master to pass the tests
      f45cb66b