1. 23 Dec, 2021 2 commits
    • Yih-Dar's avatar
      Add TFCLIPModel (#13967) · 8f2cc1c3
      Yih-Dar authored
      
      
      * Start the work for TFCLIPModel
      
      * Convert to TF code (TODO: loss + doc)
      
      * Clean up
      
      * Fix pooled_output for TFCLIPTextTransformer - using tf.gather_nd
      
      * assert -> raise error
      
      * Expose TFCLIPModel
      
      * Deal with dummy_inputs
      
      * Add tests
      
      * Fix all tests. TODO: manual check weight loading + add more comments
      
      * Fix pt tf equivalence test
      
      * fixes
      
      * update TFCLIPVisionEmbeddings's Conv2D
      
      * Fix loss + overwrite test_pt_tf_model_equivalence from common
      
      * Add a comment about the change about MainLayer in test_keras_save_load
      
      * Set return_loss=True in TFCLIPModelTester + make tests pass
      
      * overwrite test_pt_tf_model_equivalence from tf common
      
      * fix base_model_prefix
      
      * Fix examples
      
      * remove unused
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * apply review suggestions
      
      * change self.pre_layrnorm to self.pre_layernorm
      
      * apply more review suggestions
      
      * return attention probs before dropout (to align with PT)
      
      * fix weight init
      
      * fix
      
      * build doc
      
      * fix missing doc
      
      * fix for test
      Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      8f2cc1c3
    • lewtun's avatar
      Add ONNX support for MarianMT models (#14586) · 6b655cc6
      lewtun authored
      * First commit to add MarianMT to ONNX
      
      * Now MarianModel.forward() automatically generates decoder_input_ids, like BartModel.forward()
      
      * Adjusted MarianOnnxConfig.inputs and outputs to work with seq2seq-lm feature
      
      * Style fix
      
      * Added support for other features for already supported models
      
      * Partial support for causal and seq2seq models
      
      * Partial support for causal and seq2seq models
      
      * Add default task for MarianMT ONNX
      
      * Remove automatic creation of decoder_input_ids
      
      * Extend inputs and outputs for MarianMT ONNX config
      
      * Add MarianMT to ONNX unit tests
      
      * Refactor
      
      * OnnxSeq2SeqConfigWithPast to support seq2seq models
      
      * Parameterized the onnx tests
      
      * Restored run_mlm.py
      
      * Restored run_mlm.py
      
      * [WIP] BART update
      
      * BART and MBART
      
      * Add past_key_values and fix dummy decoder inputs
      
      Using a sequence length of 1 in generate_dummy_outputs() produces large discrepancies, presumably due to some hidden optimisations.
      
      * Refactor MarianOnnxConfig to remove custom past_key_values logic
      
      * Fix quality
      
      * Revert "Revert "Added support for other features for already supported models (#14358)" (#14679)"
      
      This reverts commit 0f4e39c5.
      
      * is_torch_available test to avoid failing imports
      
      * sorting parameterize parameters to solve ERROR gw0 gw1
      
      * tests fix
      
      * tests fix
      
      * GPT2 with past fix
      
      * Fixed stateful class attribute change that was breaking things when converting multiple models sequentially
      
      * Removed onnx file
      
      * Refactor Marian export to account for base changes
      
      * Fix copies
      
      * Implemented suggestions
      
      * Extend support for causal LM
      
      * Revert "Revert "Added support for other features for already supported models (#14358)" (#14679)"
      
      This reverts commit 0f4e39c5.
      
      * is_torch_available test to avoid failing imports
      
      * sorting parameterize parameters to solve ERROR gw0 gw1
      
      * tests fix
      
      * tests fix
      
      * GPT2 with past fix
      
      * Fixed stateful class attribute change that was breaking things when converting multiple models sequentially
      
      * Removed onnx file
      
      * Implemented suggestions
      
      * Fixed __init__ to resolve conflict with master
      
      * Revert "Revert "Added support for other features for already supported models (#14358)" (#14679)"
      
      This reverts commit 0f4e39c5
      
      .
      
      * is_torch_available test to avoid failing imports
      
      * sorting parameterize parameters to solve ERROR gw0 gw1
      
      * tests fix
      
      * tests fix
      
      * GPT2 with past fix
      
      * Fixed stateful class attribute change that was breaking things when converting multiple models sequentially
      
      * Removed onnx file
      
      * Implemented suggestions
      
      * Fixed __init__ to resolve conflict with master
      
      * Remove commented import
      
      * Remove ONNX model
      
      * Remove redundant class method
      
      * Tidy up imports
      
      * Fix quality
      
      * Refactor dummy input function
      
      * Add copied from statements to Marian config functions
      
      * Remove false copied from comments
      
      * Fix copy from comment
      Co-authored-by: default avatarMassimiliano Bruni <massimiliano.bruni@hcl.com>
      Co-authored-by: default avatarMichael Benayoun <mickbenayoun@gmail.com>
      6b655cc6
  2. 22 Dec, 2021 4 commits
  3. 21 Dec, 2021 2 commits
  4. 20 Dec, 2021 4 commits
  5. 17 Dec, 2021 2 commits
  6. 16 Dec, 2021 3 commits
  7. 15 Dec, 2021 5 commits
  8. 13 Dec, 2021 6 commits
  9. 11 Dec, 2021 1 commit
  10. 10 Dec, 2021 3 commits
  11. 09 Dec, 2021 3 commits
  12. 08 Dec, 2021 5 commits
    • Sylvain Gugger's avatar
      Move pyctcdecode (#14686) · 13186d71
      Sylvain Gugger authored
      * Move pyctcdecode dep
      
      * Fix doc and last objects
      
      * Quality
      
      * Style
      
      * Ignore this black
      13186d71
    • Stas Bekman's avatar
      [bf16 support] tweaks (#14580) · 12286612
      Stas Bekman authored
      
      
      * [bf16 support] tweaks
      
      * corrections
      Co-authored-by: default avatarManuel R. Ciosici <manuelrciosici@gmail.com>
      12286612
    • Sylvain Gugger's avatar
      01b8cd59
    • Sylvain Gugger's avatar
      Convert tutorials (#14665) · cf36f4d7
      Sylvain Gugger authored
      * Convert a few docs
      
      * And another
      
      * Last tutorials
      
      * New syntax for colab links
      
      * Convert a few docs
      
      * And another
      
      * Last tutorials
      
      * New syntax for colab links
      cf36f4d7
    • NielsRogge's avatar
      Add Perceiver IO (#14487) · 65b20b73
      NielsRogge authored
      * First draft
      
      * Style and remove mlm
      
      * Make forward pass work
      
      * More improvements
      
      * More improvements
      
      * Fix bug
      
      * More improvements
      
      * More improvements
      
      * Add PerceiverTokenizer first draft
      
      * Improve conversion script
      
      * More improvements
      
      * Make conversion script work for the encoder
      
      * Make conversion script work with local pickle files
      
      * Style & quality, fix-copies
      
      * Add dummy input to conversion script
      
      * Add absolute position embeddings to TextPreProcessor
      
      * Make forward pass of encoder work
      
      * More improvements
      
      * Move text preprocessor to separate script
      
      * More improvements
      
      * More improvements
      
      * Add post processor
      
      * Make MLM model work
      
      * Style
      
      * Add PerceiverForMaskedLM
      
      * Add PerceiverImagePreprocessor
      
      * Make style
      
      * Make PerceiverForImageClassification work
      
      * More improvements
      
      * More improvements
      
      * Use tokenizer in conversion script
      
      * Use PerceiverForMaskedLM in conversion script
      
      * Define custom PerceiverModelOutput
      
      * Improve PerceiverAttention to make it work for both MLM and image classification
      
      * More improvements
      
      * More improvements
      
      * More improvements to the conversion script
      
      * Make conversion script work for both MLM and image classification
      
      * Add PerceiverFeatureExtractor
      
      * More improvements
      
      * Style and quality
      
      * Add center cropping
      
      * Fix bug
      
      * Small fix
      
      * Add print statement
      
      * Fix bug in image preprocessor
      
      * Fix bug with conversion script
      
      * Make output position embeddings an nn.Parameter layer instead of nn.Embedding
      
      * Comment out print statements
      
      * Add position encoding classes
      
      * More improvements
      
      * Use position_encoding_kwargs
      
      * Add PerceiverForImageClassificationFourier
      
      * Make style & quality
      
      * Add PerceiverForImageClassificationConvProcessing
      
      * Style & quality
      
      * Add flow model
      
      * Move processors to modeling file
      
      * Make position encodings modular
      
      * Make basic decoder use modular position encodings
      
      * Add PerceiverForOpticalFlow to conversion script
      
      * Add AudioPreprocessor
      
      * Make it possible for the basic decoder to use Fourier position embeddings
      
      * Add PerceiverForMultimodalAutoencoding
      
      * Improve model for optical flow
      
      * Improve _build_network_inputs method
      
      * Add print statement
      
      * Fix device issue
      
      * Fix device of Fourier embeddings
      
      * Add print statements for debugging
      
      * Add another print statement
      
      * Add another print statement
      
      * Add another print statement
      
      * Add another print statement
      
      * Improve PerceiverAudioPreprocessor
      
      * Improve conversion script for multimodal modal
      
      * More improvements
      
      * More improvements
      
      * Improve multimodal model
      
      * Make forward pass multimodal model work
      
      * More improvements
      
      * Improve tests
      
      * Fix some more tests
      
      * Add output dataclasses
      
      * Make more tests pass
      
      * Add print statements for debuggin
      
      * Add tests for image classification
      
      * Add PerceiverClassifierOutput
      
      * More improvements
      
      * Make more tests pass for the optical flow model
      
      * Make style & quality
      
      * Small improvements
      
      * Don't support training for optical flow model for now
      
      * Fix _prepare_for_class for tests
      
      * Make more tests pass, add some docs
      
      * Add multimodal model to tests
      
      * Minor fixes
      
      * Fix tests
      
      * Improve conversion script
      
      * Make fixup
      
      * Remove pos_dim argument
      
      * Fix device issue
      
      * Potential fix for OOM
      
      * Revert previous commit
      
      * Fix test_initialization
      
      * Add print statements for debugging
      
      * Fix print statement
      
      * Add print statement
      
      * Add print statement
      
      * Add print statement
      
      * Add print statement
      
      * Add print statement
      
      * Add print statement
      
      * Remove need for output_shape
      
      * Comment out output_shape
      
      * Remove unnecessary code
      
      * Improve docs
      
      * Fix make fixup
      
      * Remove PerceiverTextProcessor from init
      
      * Improve docs
      
      * Small improvement
      
      * Apply first batch of suggestions from code review
      
      * Apply more suggestions from code review
      
      * Update docstrings
      
      * Define dicts beforehand for readability
      
      * Rename task to architecture in conversion script, include PerceiverModel in tests
      
      * Add print statements for debugging
      
      * Fix tests on GPU
      
      * Remove preprocessors, postprocessors and decoders from main init
      
      * Add integration test
      
      * Fix docs
      
      * Replace einops by torch
      
      * Update for new docs frontend
      
      * Rename PerceiverForImageClassification
      
      * Improve docs
      
      * Improve docs
      
      * Improve docs of PerceiverModel
      
      * Fix some more tests
      
      * Improve center_crop
      
      * Add PerceiverForSequenceClassification
      
      * Small improvements
      
      * Fix tests
      
      * Add integration test for optical flow model
      
      * Clean up
      
      * Add tests for tokenizer
      
      * Fix tokenizer by adding special tokens properly
      
      * Fix CI
      65b20b73