1. 04 Aug, 2022 1 commit
    • NielsRogge's avatar
      Add VideoMAE (#17821) · f9a0008d
      NielsRogge authored
      
      
      * First draft
      
      * Add VideoMAEForVideoClassification
      
      * Improve conversion script
      
      * Add VideoMAEForPreTraining
      
      * Add VideoMAEFeatureExtractor
      
      * Improve VideoMAEFeatureExtractor
      
      * Improve docs
      
      * Add first draft of model tests
      
      * Improve VideoMAEForPreTraining
      
      * Fix base_model_prefix
      
      * Make model take pixel_values of shape (B, T, C, H, W)
      
      * Add loss computation of VideoMAEForPreTraining
      
      * Improve tests
      
      * Improve model testsé
      
      * Make all tests pass
      
      * Add VideoMAE to main README
      
      * Add tests for VideoMAEFeatureExtractor
      
      * Add integration test
      
      * Improve conversion script
      
      * Rename patch embedding class
      
      * Remove VideoMAELayer from init
      
      * Update design of patch embeddings
      
      * Improve comments
      
      * Improve conversion script
      
      * Improve conversion script
      
      * Add conversion of pretrained model
      
      * Add loss verification of pretrained model
      
      * Add loss verification of unnormalized targets
      
      * Add integration test for pretraining model
      
      * Apply suggestions from code review
      
      * Fix bug to make feature extractor resize only shorter edge
      
      * Address more comments
      
      * Improve normalization of videos
      
      * Add doc examples
      
      * Move constants to dedicated script
      
      * Remove scripts
      
      * Transfer checkpoints, fix docs
      
      * Update script
      
      * Update image mean and std
      
      * Fix doc tests
      
      * Set return_tensors to NumPy by default
      
      * Revert the previous change
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      f9a0008d
  2. 27 Jul, 2022 2 commits
    • Ritik Nandwal's avatar
      Add swin transformer v2 (#17469) · e87ac9d1
      Ritik Nandwal authored
      
      
      * Add files generated using transformer-cli add-new-model-like command
      
      * Add changes for swinv2 attention and forward method
      
      * Add fixes
      
      * Add modifications for weight conversion and remaining args in swin model
      
      * Add changes for patchmerging
      
      * Add changes for SwinV2selfattention
      
      * Update conversion script
      
      * Add final fixes for the swin_v2 model
      
      * Add changes for conversion script for pretrained window size case
      
      * Add pretrained window size value from config in SwinV2Encoder class
      
      * Make fixup
      
      * Add swinv2 to models_not_in_readme to utils/check_copies.py
      
      * Modify Swinv2v2 to Swin Transformer V2
      
      * Remove copied from, to run make fixup command
      
      * Add updates to swinv2tf from main branch
      
      * Add pretrained_window_size to config, to make tests pass
      
      * Add modified weights from nandwalritik profile for swinv2
      
      * Update model weights from swinv2 from nandwalritik profile
      
      * Add fix for build_pr_documentation CI fix
      
      * Add fixes for weight conversion
      
      * Add change to make input with padding work
      
      * Add fixes for test cases
      
      * Add few changes from swin to swinv2 to pass test cases
      
      * Remove tests for tensorflow as swinv2 for TF is not added yet
      
      * Overide test_pt_tf_model_equivalence function as TF implementation for swinv2 is not added yet
      
      * Add modeling_tf_swinv2 to _ignore_modules as test file is removed for this one right now.
      
      * Update docs url for swinv2 in README.md
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Undo changes for check_repo
      
      * Update url in readme.md
      
      * Remove overrided function to test pt_tf_model_equivalence
      
      * Remove TF model imports for Swinv2 as its not implemented in this PR
      
      * Add changes for index.mdx
      
      * Add swinv2 papers link,abstract and contributors details
      
      * Rename cpb_mlp to continous_position_bias_mlp
      
      * Add tips for swinv2 model
      
      * Update src/transformers/models/swinv2/configuration_swinv2.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update src/transformers/models/swinv2/configuration_swinv2.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Fix indentation for docstring example in src/transformers/models/swinv2/configuration_swinv2.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update import order in src/transformers/models/swinv2/configuration_swinv2.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Add copyright statements in weights conversion script.
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Remove Swinv2 from models_not_in_readme
      
      * Reformat code
      
      * Remove TF implementation file for swinv2
      
      * Update start docstring.
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Add changes for docstring
      
      * Update orgname for weights to microsoft
      
      * Remove to_2tuple function
      
      * Add copied from statements wherever applicable
      
      * Add copied from to Swinv2ForMaskedImageModelling class
      
      * Reformat code.
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Add unittest.skip(with reason.) for test_inputs_embeds test case.
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Add updates for test_modeling_swinv2.py
      
      * Add @unittest.skip() annotation for clarity to create_and_test_config_common_properties function
      
      * Add continuous_position_bias_mlp parameter to conversion script
      
      * Add test for testing masked_image_modelling for swinv2
      
      * Update Swinv2 to Swin Transformer v2 in docs/source/en/model_doc/swinv2.mdx
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update Swinv2 to Swin Transformer v2 in docs/source/en/model_doc/swinv2.mdx
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update docs/source/en/model_doc/swinv2.mdx
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update docs/source/en/model_doc/swinv2.mdx
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Add suggested changes
      
      * Add copied from to forward methods of Swinv2Stage and Swinv2Encoder
      
      * Add push_to_hub flag to weight conversion script
      
      * Change order or Swinv2DropPath class
      
      * Add id2label mapping for imagenet 21k
      
      * Add updated url for SwinV2 functions and classes used in implementation
      
      * Update input_feature dimensions format, mentioned in comments.
      Co-authored-by: default avatarAlara Dirik <8944735+alaradirik@users.noreply.github.com>
      
      * Add suggested changes for modeling_swin2.py
      
      * Update docs
      
      * Remove create_and_test_config_common_properties function, as test_model_common_attributes is sufficient.
      
      * Fix indentation.
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Add changes for making Nit objects in code style
      
      * Add suggested changes
      
      * Add suggested changes for test_modelling_swinv2
      
      * make fix-copies
      
      * Update docs/source/en/model_doc/swinv2.mdx
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      Co-authored-by: default avatarAlara Dirik <8944735+alaradirik@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      e87ac9d1
    • Lysandre's avatar
      Dev version · c89a592e
      Lysandre authored
      c89a592e
  3. 22 Jul, 2022 1 commit
    • Alara Dirik's avatar
      Add OWL-ViT model for zero-shot object detection (#17938) · 12d66b47
      Alara Dirik authored
      * add owlvit model skeleton
      
      * add class and box predictor heads
      
      * convert modified flax clip to pytorch
      
      * fix box and class predictors
      
      * add OwlViTImageTextEmbedder
      
      * convert class and box head checkpoints
      
      * convert image text embedder checkpoints
      
      * add object detection head
      
      * fix bugs
      
      * update conversion script
      
      * update conversion script
      
      * fix q,v,k,out weight conversion conversion
      
      * add owlvit object detection output
      
      * fix bug in image embedder
      
      * fix bugs in text embedder
      
      * fix positional embeddings
      
      * fix bug in inference mode vision pooling
      
      * update docs, init tokenizer and processor files
      
      * support batch processing
      
      * add OwlViTProcessor
      
      * remove merge conflicts
      
      * readd owlvit imports
      
      * fix bug in OwlViTProcessor imports
      
      * fix bugs in processor
      
      * update docs
      
      * fix bugs in processor
      
      * update owlvit docs
      
      * add OwlViTFeatureExtractor
      
      * style changes, add postprocess method to feature extractor
      
      * add feature extractor and processor tests
      
      * add object detection tests
      
      * update conversion script
      
      * update config paths
      
      * update config paths
      
      * fix configuration paths and bugs
      
      * fix bugs in OwlViT tests
      
      * add import checks to processor
      
      * fix docs and minor issues
      
      * fix docs and minor issues
      
      * fix bugs and issues
      
      * fix bugs and issues
      
      * fix bugs and issues
      
      * fix bugs and issues
      
      * update docs and examples
      
      * fix bugs and issues
      
      * update conversion script, fix positional embeddings
      
      * process 2D input ids, update tests
      
      * fix style and quality issues
      
      * update docs
      
      * update docs and imports
      
      * update OWL-ViT index.md
      
      * fix bug in OwlViT feature ext tests
      
      * fix code examples, return_dict by default
      
      * return_dict by default
      
      * minor fixes, add tests to processor
      
      * small fixes
      
      * add output_attentions arg to main model
      
      * fix bugs
      
      * remove output_hidden_states arg from main model
      
      * update self.config variables
      
      * add option to return last_hidden_states
      
      * fix bug in config variables
      
      * fix copied from statements
      
      * fix small issues and bugs
      
      * fix bugs
      
      * fix bugs, support greyscale images
      
      * run fixup
      
      * update repo name
      
      * merge OwlViTImageTextEmbedder with obj detection head
      
      * fix merge conflict
      
      * fix merge conflict
      
      * make fixup
      
      * fix bugs
      
      * fix bugs
      
      * add additional processor test
      12d66b47
  4. 19 Jul, 2022 2 commits
  5. 18 Jul, 2022 1 commit
  6. 29 Jun, 2022 2 commits
  7. 28 Jun, 2022 1 commit
  8. 24 Jun, 2022 1 commit
    • rooa's avatar
      Add CodeGen model (#17443) · d6b6fb99
      rooa authored
      
      
      * Add CodeGen model
      
      * Add missing key and switch order of super()
      
      * Fix torch.ones init with uint8 instead of bool
      
      * Address comments: copy statements and doc
      
      * update tests
      
      * remove old model parallel
      
      * fix batch gen tests
      
      * fix batch gen test
      
      * update test_gpt2_sample_max_time
      
      * fix codgen test and revert gpt2 test change
      
      * Fix incorrect tie_word_embedding value, typo, URL
      
      * Fix model order in README and styling
      
      * Reorder model list alphabetically
      
      * Set tie_word_embedding to False by default
      
      * Apply suggestions from code review
      
      * Better attn mask name & remove attn masked_bias
      
      * add tokenizer for codegen
      
      * quality
      
      * doc tokenizer
      
      * fix-copies
      
      * add CodeGenTokenizer in converter
      
      * make truncation optional
      
      * add test for truncation
      
      * add copyright
      
      * fix-copies
      
      * fix fast tokenizer decode
      
      * Update src/transformers/models/codegen/tokenization_codegen.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * increase vocab_size in tests
      Co-authored-by: default avatarpatil-suraj <surajp815@gmail.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      d6b6fb99
  9. 23 Jun, 2022 1 commit
  10. 21 Jun, 2022 1 commit
  11. 16 Jun, 2022 1 commit
  12. 15 Jun, 2022 1 commit
  13. 13 Jun, 2022 1 commit
    • Daniel Stancl's avatar
      Add `LongT5` model (#16792) · a72f1c9f
      Daniel Stancl authored
      
      
      * Initial commit
      
      * Make some fixes
      
      * Make PT model full forward pass
      
      * Drop TF & Flax implementation, fix copies etc
      
      * Add Flax model and update some corresponding stuff
      
      * Drop some TF things
      
      * Update config and flax local attn
      
      * Add encoder_attention_type to config
      
      * .
      
      * Update docs
      
      * Do some cleansing
      
      * Fix some issues -> make style; add some docs
      
      * Fix position_bias + mask addition + Update tests
      
      * Fix repo consistency
      
      * Fix model consistency by removing flax operation over attn_mask
      
      * [WIP] Add PT TGlobal LongT5
      
      * .
      
      * [WIP] Add flax tglobal model
      
      * [WIP] Update flax model to use the right attention type in the encoder
      
      * Fix flax tglobal model forward pass
      
      * Make the use of global_relative_attention_bias
      
      * Add test suites for TGlobal model
      
      * Fix minor bugs, clean code
      
      * Fix pt-flax equivalence though not convinced with correctness
      
      * Fix LocalAttn implementation to match the original impl. + update READMEs
      
      * Few updates
      
      * Update: [Flax] improve large model init and loading #16148
      
      * Add ckpt conversion script accoring to #16853 + handle torch device placement
      
      * Minor updates to conversion script.
      
      * Typo: AutoModelForSeq2SeqLM -> FlaxAutoModelForSeq2SeqLM
      
      * gpu support + dtype fix
      
      * Apply some suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * * Remove (de)parallelize stuff
      * Edit shape comments
      * Update README.md
      * make fix-copies
      
      * Remove caching logic for local & tglobal attention
      
      * Apply another batch of suggestions from code review
      
      * Add missing checkpoints
      * Format converting scripts
      * Drop (de)parallelize links from longT5 mdx
      
      * Fix converting script + revert config file change
      
      * Revert "Remove caching logic for local & tglobal attention"
      
      This reverts commit 2a619828f6ddc3e65bd9bb1725a12b77fa883a46.
      
      * Stash caching logic in Flax model
      
      * Make side relative bias used always
      
      * Drop caching logic in PT model
      
      * Return side bias as it was
      
      * Drop all remaining model parallel logic
      
      * Remove clamp statements
      
      * Move test files to the proper place
      
      * Update docs with new version of hf-doc-builder
      
      * Fix test imports
      
      * Make some minor improvements
      
      * Add missing checkpoints to docs
      * Make TGlobal model compatible with torch.onnx.export
      * Replace some np.ndarray with jnp.ndarray
      
      * Fix TGlobal for ONNX conversion + update docs
      
      * fix _make_global_fixed_block_ids and masked neg  value
      
      * update flax model
      
      * style and quality
      
      * fix imports
      
      * remove load_tf_weights_in_longt5 from init and fix copies
      
      * add slow test for TGlobal model
      
      * typo fix
      
      * Drop obsolete is_parallelizable and one warning
      
      * Update __init__ files to fix repo-consistency
      
      * fix pipeline test
      
      * Fix some device placements
      
      * [wip]: Update tests -- need to generate summaries to update expected_summary
      
      * Fix quality
      
      * Update LongT5 model card
      
      * Update (slow) summarization tests
      
      * make style
      
      * rename checkpoitns
      
      * finish
      
      * fix flax tests
      Co-authored-by: default avatarphungvanduy <pvduy23@gmail.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarpatil-suraj <surajp815@gmail.com>
      a72f1c9f
  14. 09 Jun, 2022 1 commit
  15. 07 Jun, 2022 1 commit
    • Chan Woo Kim's avatar
      M-CTC-T Model (#16402) · 119e3c0f
      Chan Woo Kim authored
      
      
      * added cbs to notebooks, made copy-paste error fix in generation_utils
      
      * initial push for mctc model
      
      * mctc feature extractor done
      
      * added processor, tokenizer and their tests for MCTC. Have added an MCTC modeling test, adjusting model code accordingly.
      
      * added processor, tokenizer and their tests for MCTC. Have added an MCTC modeling test, adjusting model code accordingly.
      
      * passing attention, now struggling to figure out how attention masks make sense here
      
      * works when excluding attention masks. ask later how one would integrate attention maskshere
      
      * bizarre configuration error (model prefix comes first in config dict json and messes up the order)
      
      * all passing but bizzarre config dict ordering issue when to_dict
      
      * passing all major tests
      
      * feature extraction, processor, tokenizer added & tests passing
      
      * style & consistency & other logistical fixes
      
      * copy paste fix
      
      * model after feature extraction working
      
      * commiting final feature extraction results; need to fix normalization
      
      * feature extraction passing tests; probably should add tests on the specific flashlight-copied functions?
      
      * delete print ; format code a bit
      
      * fixing tests
      
      * passing major tests
      
      * fixing styles
      
      * completed tokenization test with real example; not sure if these values are entirely correct.
      
      * last test fixes from local
      
      * reverting accidentally included custom setup configs
      
      * remove load tf weights; fix config error
      
      * testing couldnt import featureextractor
      
      * fix docs
      
      * fix docs
      
      * resolving comments
      
      * style fixes
      
      * style fixes
      
      * Update to MCTCConv1dSubSampler
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * relposemb fixes
      
      * conv1d name issue; expecting config fail with paraentheses
      
      * fix config issue
      
      * fix config issue
      
      * fix config issue
      
      * change everything to MCTCT
      
      * fixing naming change errors
      
      * archive list
      
      * copyrights and docs
      
      * copyrights and docs
      
      * copyrights and docs
      
      * merge resolution
      
      * move tests, fix to changed optionaldependency structure
      
      * test directories changed
      
      * fixing tests
      
      * how to avoid tf tests?
      
      * how to avoid tf tests?
      
      * tests passing locally
      
      * allow mctctprocessor imported any env
      
      * allow mctctprocessor imported any env
      
      * fixed second round of feedback, need to fix docs
      
      * doc changes not being applied
      
      * all fixed
      
      * style fix
      
      * feedback fixes
      
      * fix copies and feature extraction style fix
      
      * Update tests/models/visual_bert/test_modeling_visual_bert.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * copy paste huggingface:main visual bert
      
      * added eof newline to visual bert; all tests are passing otherwise
      
      * fix slow tests by adding attention mask
      
      * change model id to speechbrain
      
      * make fix-copies
      
      * fix readme unwanted deletes
      
      * fixing readmes, make fix-copies
      
      * consistent M-CTC-T naming
      
      * Update src/transformers/models/mctct/__init__.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * all fixed but variable naming
      
      * adjust double quotes
      
      * fixed variable names
      
      * copyright and mr quilter
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * correct slow tests
      
      * make fix-copies
      
      * Update src/transformers/models/mctct/configuration_mctct.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/mctct/configuration_mctct.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * m-ctc-t not mctct
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      119e3c0f
  16. 02 Jun, 2022 1 commit
  17. 01 Jun, 2022 1 commit
  18. 24 May, 2022 2 commits
    • Jason Phang's avatar
      [WIP] Adding GPT-NeoX-20B (#16659) · 71e60272
      Jason Phang authored
      
      
      * initial
      
      * first try
      
      * working 20B
      
      * 20B tokenizers
      
      * Docs
      
      * Import fixes for missing classes
      
      * Update docs, fixup
      
      * black formatting
      
      * isort
      
      * flake
      
      * dummy objects
      
      * documentation
      
      * Documentation yml
      
      * more docs
      
      * tweaks for tests
      
      * tokenization auto
      
      * fix neox tests
      
      * test
      
      * test
      
      * einsum
      
      * address PR feedback
      
      * Documentation
      
      * Update README.md
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/gpt_neox/__init__.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/gpt_neox/configuration_gpt_neox.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Remove undefined LaTeX syntax
      
      * Update to full url to avoid confusion about if that's supposed to refer to the Hub
      
      * fix auto
      
      * move tests
      
      * documentation fix
      
      * more doc fixes
      
      * test refactor
      
      * fix import
      
      * fix import
      
      * fix import
      
      * fix import
      
      * fix import
      
      * style fixes
      
      * More modeling fixes
      Co-authored-by: default avatarJason Phang <zp489@gr057.hpc.nyu.edu>
      Co-authored-by: default avatarStella Biderman <stellabiderman@gmail.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      71e60272
    • NielsRogge's avatar
      Add LayoutLMv3 (#17060) · 31ee80d5
      NielsRogge authored
      
      
      * Make forward pass work
      
      * More improvements
      
      * Remove unused imports
      
      * Remove timm dependency
      
      * Improve loss calculation of token classifier
      
      * Fix most tests
      
      * Add docs
      
      * Add model integration test
      
      * Make all tests pass
      
      * Add LayoutLMv3FeatureExtractor
      
      * Improve integration test + make fixup
      
      * Add example script
      
      * Fix style
      
      * Add LayoutLMv3Processor
      
      * Fix style
      
      * Add option to add visual labels
      
      * Make more tokenizer tests pass
      
      * Fix more tests
      
      * Make more tests pass
      
      * Fix bug and improve docs
      
      * Fix import of processors
      
      * Improve docstrings
      
      * Fix toctree and improve docs
      
      * Fix auto tokenizer
      
      * Move tests to model folder
      
      * Move tests to model folder
      
      * change default behavior add_prefix_space
      
      * add prefix space for fast
      
      * add_prefix_spcae set to True for Fast
      
      * no space before `unique_no_split` token
      
      * add test to hightligh special treatment of added tokens
      
      * fix `test_batch_encode_dynamic_overflowing` by building a long enough example
      
      * fix `test_full_tokenizer` with add_prefix_token
      
      * Fix tokenizer integration test
      
      * Make the code more readable
      
      * Add tests for LayoutLMv3Processor
      
      * Fix style
      
      * Add model to README and update init
      
      * Apply suggestions from code review
      
      * Replace asserts by value errors
      
      * Add suggestion by @ducviet00
      
      * Add model to doc tests
      
      * Simplify script
      
      * Improve README
      
      * a step ahead to fix
      
      * Update pair_input_test
      
      * Make all tokenizer tests pass - phew
      
      * Make style
      
      * Add LayoutLMv3 to CI job
      
      * Fix auto mapping
      
      * Fix CI job name
      
      * Make all processor tests pass
      
      * Make tests of LayoutLMv2 and LayoutXLM consistent
      
      * Add copied from statements to fast tokenizer
      
      * Add copied from statements to slow tokenizer
      
      * Remove add_visual_labels attribute
      
      * Fix tests
      
      * Add link to notebooks
      
      * Improve docs of LayoutLMv3Processor
      
      * Fix reference to section
      Co-authored-by: default avatarSaulLu <lucilesaul.com@gmail.com>
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      31ee80d5
  19. 23 May, 2022 1 commit
  20. 18 May, 2022 1 commit
  21. 17 May, 2022 1 commit
  22. 12 May, 2022 1 commit
  23. 11 May, 2022 1 commit
    • Amanpreet Singh's avatar
      [feat] Add FLAVA model (#16654) · a10f6183
      Amanpreet Singh authored
      * [WIP] Add FLAVA model
      
      This PR aims to add [FLAVA](ihttps://arxiv.org/abs/2112.04482) model to the transformers repo.
      
      Following checklist delineates the list of things to be done for this PR
      to be complete:
      
      [x] Flava init
      [x] Flava base models
      [x] Flava layers
      [x] Flava Configs
      [x] Flava encoders
      [x] Flava pretraining models
      [ ] Flava classification/retrieval models (To be added in a separate PR)
      [x] Documentation updates 
      [x] Imports updates 
      [x] Argstring updates
      [x] Flava pretrained checkpoints 
      [x] Flava tests
      [x] Flava processors 
      [x] Sanity check
      [x] Lint
      a10f6183
  24. 02 May, 2022 1 commit
    • NielsRogge's avatar
      Add YOLOS (#16848) · 1ac69874
      NielsRogge authored
      
      
      * First draft
      
      * Add YolosForObjectDetection
      
      * Make forward pass work
      
      * Add mid position embeddings
      
      * Add interpolation of position encodings
      
      * Add expected values
      
      * Add YOLOS to tests
      
      * Add integration test
      
      * Support tiny model as well
      
      * Support all models in conversion script
      
      * Remove mid_pe_size attribute
      
      * Make more tests pass
      
      * Add model to README and fix config
      
      * Add copied from statements
      
      * Rename base_model_prefix to vit
      
      * Add missing YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP
      
      * Apply suggestions from code review
      
      * Apply more suggestions from code review
      
      * Convert remaining checkpoints
      
      * Improve docstrings
      
      * Add YolosFeatureExtractor
      
      * Add feature extractor to docs
      
      * Add corresponding tests
      
      * Fix style
      
      * Fix docs
      
      * Apply suggestion from code review
      
      * Fix bad rebase
      
      * Fix some more bad rebase
      
      * Fix missing character
      
      * Improve docs and variable names
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      1ac69874
  25. 28 Apr, 2022 1 commit
  26. 08 Apr, 2022 1 commit
    • NielsRogge's avatar
      Add TAPEX (#16473) · 4ef0abb7
      NielsRogge authored
      
      
      * Add TapexTokenizer
      
      * Improve docstrings and provide option to provide answer
      
      * Remove option for pretokenized inputs
      
      * Add TAPEX to README
      
      * Fix copies
      
      * Remove option for pretokenized inputs
      
      * Initial commit: add tapex fine-tuning examples on both table-based question answering and table-based fact verification.
      
      * - Draft a README file for running the script and introducing some background.
      - Remove unused code lines in tabfact script.
      - Disable the deafult `pad_to_max_length` option which is memory-consuming.
      
      * * Support `as_target_tokenizer` function for TapexTokenizer.
      * Fix the do_lower_case behaviour of TapexTokenizer.
      * Add unit tests for target scenarios and cased/uncased scenarios for both source and target.
      
      * * Replace the label BartTokenizer with TapexTokenizer's as_target_tokenizer function.
      * Fix typos in tapex example README.
      
      * * fix the evaluation script - remove the property `task_name`
      
      * * Make the label space more clear for tabfact tasks
      
      * * Using a new fine-tuning script for tapex-base on tabfact.
      
      * * Remove the lowercase code outside the tokenizer - we use the tokenizer to control whether do_lower_case
      * Guarantee the hyper-parameter can be run without out-of-memory on 16GB card and report the new reproduced number on wikisql
      
      * * Remove the default tokenizer_name option.
      * Provide evaluation command.
      
      * * Support for WikiTableQuestion dataset.
      
      * Fix a typo in README.
      
      * * Fix the datasets's key name in WikiTableQuestions
      
      * Run make fixup and move test to folder
      
      * Fix quality
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Apply some more suggestions from code review
      
      * Improve docstrings
      
      * Overwrite failing test
      
      * Improve comment in example scripts
      
      * Fix rebase
      
      * Add TAPEX to Auto mapping
      
      * Add TAPEX to auto config mappings
      
      * Put TAPEX higher than BART in auto mapping
      
      * Add TAPEX to doc tests
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MBP.localdomain>
      Co-authored-by: default avatarSivilTaram <qianlxc@outlook.com>
      Co-authored-by: default avatarNiels Rogge <nielsrogge@nielss-mbp.home>
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      4ef0abb7
  27. 07 Apr, 2022 2 commits
  28. 28 Mar, 2022 1 commit
    • NielsRogge's avatar
      Add DPT (#15991) · 979b039c
      NielsRogge authored
      
      
      * First draft
      
      * More improvements
      
      * Add fusion blocks
      
      * Make conversion script work for dpt_large
      
      * Make conversion script work
      
      * Improve implementation
      
      * Improve conversion script
      
      * Add DPTForSemanticSegmentation
      
      * Make conversion work for semantic segmentation
      
      * Add tests
      
      * Remove print statements
      
      * First draft
      
      * Redesign neck
      
      * Improve tests
      
      * Improve implementation some more
      
      * Make neck output list of tensors
      
      * Improve neck and feature extractor
      
      * Fix integration tests
      
      * Make more tests pass
      
      * Make all tests pass
      
      * Add missing config archive map
      
      * Add in_index attribute to make heads accept list of tensors
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Apply some more suggestions
      
      * Add copied from statements
      
      * Remove assert
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      * Remove DPTInterpolate in favor of nn.Upsample
      
      * Add comments
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      * Add proposed design
      
      * Update design
      
      * Add DPTReassembleLayer
      
      * Add DPTFeatureFusionStage
      
      * Apply more suggestions from code review
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      * Fix rebase
      
      * Update in_index and out_indices
      
      * Fix conversion script
      
      * Fix code quality
      
      * Add model to toctree and use DepthEstimatorOutput
      
      * Fix rebase
      
      * Fix code examples
      
      * Improve code
      
      * Fix copied from statements
      
      * Apply suggestions from code review
      
      * Remove compute_loss method
      
      * Apply suggestions from code review
      
      * Fix documentation tests file
      
      * Remove test.py file
      
      * Improve doc example
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarNiels Rogge <nielsrogge@nielss-mbp.home>
      979b039c
  29. 24 Mar, 2022 1 commit
  30. 23 Mar, 2022 2 commits
    • Edward Beeching's avatar
      Decision transformer gym (#15845) · aff9bc40
      Edward Beeching authored
      
      
      * Created the Decision Transformer Modle
      
      * updating tests, copy to other machine
      
      * Added last hidden size to Decision Transformer modelling outputs
      
      * Removed copy of original DT file
      
      * made a temporary change to gpt2 to have it conform with the Decision Transformer version
      
      * Updated tests
      
      * Ignoring a file used to test the DT model
      
      * added comments to config file
      
      * added comments and argument descriptions to decision transformer file
      
      * Updated doc
      
      * Ran "make style"
      
      * Remove old model imports
      
      * Removed unused imports, cleaned up init file
      
      * Update docs/source/model_doc/decision_transformer.mdx
      
      added my username
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Reverted changes made to gpt2
      
      * Removed datasets submodule
      
      * Update the modeling outputs to include gpt2 attentions, hidden states and last hidden states
      
      * Added support for return of hidden states, attentions and return dict of gpt2 model.
      
      * Updated tests to include many of the ModelTesterMixin tests. 
      
      The following tests are skipped: test_generate_without_input_ids, test_pruning, test_resize_embeddings, test_head_masking, test_attention_outputs, test_hidden_states_output, test_inputs_embeds, test_model_common_attributes
      
      * Added missing line to the end of gpt2 file
      
      * Added an integration test for the Decision Transformer
      
      Test performs and autoregressive evaluation for two time steps
      
      * Set done and info to _ to fix failing test
      
      * Updated integration test to be deterministic and check expected outputs
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Removed unnecessary config options
      
      * Cleaned up commented code and old comments.
      
      * Cleaned up commented code.
      
      * Changed DecisionTransformer to Decision Transformer
      
      * Added Decision Transformer to the main README file
      
      * Added copy of GTP2 called DecisionTranformerGPT2Model
      
      * isorted imports
      
      * isorted imports
      
      * Added model to non-English README files
      
      * Ran make fix-copies and corrected some cases.
      
      * Updated index file to include Decision Transformer
      
      * Added gpt2 model as copy inside the Decision Transformer model file
      
      * Added the unit test file to the list of TEST_FILES_WITH_NO_COMMON_TESTS
      
      * Deleted redundant checkpoint files (I don't know how these got committed)
      
      * Removed testing files. (These should have never been committed)
      
      * Removed accidentally committed files
      
      * Moved the Decision Transformer test to its own directory
      
      * Add type hints for Pegasus (#16324)
      
      * Funnel type hints (#16323)
      
      * add pt funnel type hints
      
      * add tf funnel type hints
      
      * Add type hints for ProphetNet PyTorch (#16272)
      
      * [GLPN] Improve docs (#16331)
      
      * Add link to notebook
      
      * Add link
      
      * Fix bug
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      
      * Added type hints for Pytorch Marian calls (#16200)
      
      * Added type hinting for forward functions in pytorch marian
      
      * typo correction
      
      * Removed type hints on functions from BART per Suraj Patil request
      
      * fix import pb
      
      * fix typo
      
      * corrected tuple call
      
      * ran black
      
      * after fix-copies
      Some optional tags on primitives were removed, past_key_values in MarianForCausalLM changed from Tuple of Tuple to List
      
      * Fixing copies to roformer and pegasus
      Co-authored-by: default avatarClementine Fourrier <cfourrie@inria.fr>
      Co-authored-by: default avatarmatt <rocketknight1@gmail.com>
      
      * Moved DecisionTransformOutput to modeling_decision_transformer
      
      * Moved the example usage to research project and cleaned comments
      
      * Made tests ignore the copy of gpt2 in Decision Transformer
      
      * Added module output to modelling decision transformer
      
      * removed copied gpt2 model from list of transformers models
      
      * Updated tests and created __init__ file for new test location
      
      * Update README.md
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/decision_transformer/configuration_decision_transformer.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Removed unneeded summary type from config file
      
      * Fixed copies
      
      * Updated pretrained config map to refer to hopper-medium checkpoint
      
      * done (#16340)
      
      * Added Decision transformer to model docs
      
      * Update src/transformers/models/decision_transformer/modeling_decision_transformer.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/decision_transformer/modeling_decision_transformer.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/decision_transformer/configuration_decision_transformer.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Add type annotations for Rembert/Splinter and copies (#16338)
      
      * undo black autoformat
      
      * minor fix to rembert forward with default
      
      * make fix-copies, make quality
      
      * Adding types to template model
      
      * Removing List from the template types
      
      * Remove `Optional` from a couple of types that don't accept `None`
      Co-authored-by: default avatarmatt <rocketknight1@gmail.com>
      
      * [Bug template] Shift responsibilities for long-range (#16344)
      
      * Fix code repetition in serialization guide (#16346)
      
      * Adopt framework-specific blocks for content (#16342)
      
      *  refactor code samples with framework-specific blocks
      
      *  update training.mdx
      
      * 🖍
      
       apply feedback
      
      * Updates the default branch from master to main (#16326)
      
      * Updates the default branch from master to main
      
      * Links from `master` to `main`
      
      * Typo
      
      * Update examples/flax/README.md
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Updated model with custom docstring example
      
      * Created the Decision Transformer Modle
      
      * updating tests, copy to other machine
      
      * Added last hidden size to Decision Transformer modelling outputs
      
      * Removed copy of original DT file
      
      * made a temporary change to gpt2 to have it conform with the Decision Transformer version
      
      * Updated tests
      
      * Ignoring a file used to test the DT model
      
      * added comments to config file
      
      * added comments and argument descriptions to decision transformer file
      
      * Updated doc
      
      * Ran "make style"
      
      * Remove old model imports
      
      * Removed unused imports, cleaned up init file
      
      * Update docs/source/model_doc/decision_transformer.mdx
      
      added my username
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Reverted changes made to gpt2
      
      * Removed datasets submodule
      
      * Update the modeling outputs to include gpt2 attentions, hidden states and last hidden states
      
      * Added support for return of hidden states, attentions and return dict of gpt2 model.
      
      * Updated tests to include many of the ModelTesterMixin tests. 
      
      The following tests are skipped: test_generate_without_input_ids, test_pruning, test_resize_embeddings, test_head_masking, test_attention_outputs, test_hidden_states_output, test_inputs_embeds, test_model_common_attributes
      
      * Added missing line to the end of gpt2 file
      
      * Added an integration test for the Decision Transformer
      
      Test performs and autoregressive evaluation for two time steps
      
      * Set done and info to _ to fix failing test
      
      * Updated integration test to be deterministic and check expected outputs
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Removed unnecessary config options
      
      * Cleaned up commented code and old comments.
      
      * Cleaned up commented code.
      
      * Changed DecisionTransformer to Decision Transformer
      
      * Added Decision Transformer to the main README file
      
      * Added copy of GTP2 called DecisionTranformerGPT2Model
      
      * isorted imports
      
      * isorted imports
      
      * Added model to non-English README files
      
      * Ran make fix-copies and corrected some cases.
      
      * Updated index file to include Decision Transformer
      
      * Added gpt2 model as copy inside the Decision Transformer model file
      
      * Added the unit test file to the list of TEST_FILES_WITH_NO_COMMON_TESTS
      
      * Deleted redundant checkpoint files (I don't know how these got committed)
      
      * Removed testing files. (These should have never been committed)
      
      * Removed accidentally committed files
      
      * Moved the Decision Transformer test to its own directory
      
      * Moved DecisionTransformOutput to modeling_decision_transformer
      
      * Moved the example usage to research project and cleaned comments
      
      * Made tests ignore the copy of gpt2 in Decision Transformer
      
      * Added module output to modelling decision transformer
      
      * removed copied gpt2 model from list of transformers models
      
      * Updated tests and created __init__ file for new test location
      
      * Update README.md
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/decision_transformer/configuration_decision_transformer.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Removed unneeded summary type from config file
      
      * Fixed copies
      
      * Updated pretrained config map to refer to hopper-medium checkpoint
      
      * Added Decision transformer to model docs
      
      * Update src/transformers/models/decision_transformer/modeling_decision_transformer.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/decision_transformer/modeling_decision_transformer.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/decision_transformer/configuration_decision_transformer.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Updated model with custom docstring example
      
      * Updated copies, config auto, and readme files.
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarDan Tegzes <48134725+Tegzes@users.noreply.github.com>
      Co-authored-by: default avatarAdam Montgomerie <adam@avanssion.com>
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      Co-authored-by: default avatarClémentine Fourrier <22726840+clefourrier@users.noreply.github.com>
      Co-authored-by: default avatarClementine Fourrier <cfourrie@inria.fr>
      Co-authored-by: default avatarmatt <rocketknight1@gmail.com>
      Co-authored-by: default avatarFrancesco Saverio Zuppichini <francesco.zuppichini@gmail.com>
      Co-authored-by: default avatarJacob Dineen <54680234+jacobdineen@users.noreply.github.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarOmar Sanseviero <osanseviero@gmail.com>
      Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>
      Co-authored-by: default avatarLysandre Debut <lysandre.debut@reseau.eseo.fr>
      aff9bc40
    • Lysandre Debut's avatar
      Updates the default branch from master to main (#16326) · eca77f47
      Lysandre Debut authored
      
      
      * Updates the default branch from master to main
      
      * Links from `master` to `main`
      
      * Typo
      
      * Update examples/flax/README.md
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      eca77f47
  31. 22 Mar, 2022 1 commit
    • NielsRogge's avatar
      Add GLPN (#16199) · 0c55d47c
      NielsRogge authored
      
      
      * First draft
      
      * Fix logits calculation
      
      * Improve tests
      
      * Add copied from statements
      
      * Fix base_model_prefix
      
      * Improve implementation, upload new models
      
      * Update design
      
      * Fix integration test
      
      * Add model to README and toctree
      
      * Add document image
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Add decoder_hidden_size attribute
      
      * Update design of decoder
      
      * Add DepthEstimatorOutput class
      
      * Rename in_index to head_in_index and add feature extractor tests
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      
      * Update pretrained model name and add to doc tests
      
      * Remove test.py script
      
      * Update copied from statements and clean up
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      0c55d47c
  32. 15 Mar, 2022 1 commit
  33. 14 Mar, 2022 1 commit
  34. 10 Mar, 2022 1 commit