1. 12 May, 2023 1 commit
  2. 09 May, 2023 2 commits
    • Sylvain Gugger's avatar
      v4.30.0.dev0 · a0c0a782
      Sylvain Gugger authored
      a0c0a782
    • Sylvain Gugger's avatar
      Add RWKV-4 (#22797) · b4d4d6fe
      Sylvain Gugger authored
      
      
      * First draft of RWKV-4
      
      * Add support for generate
      
      * Style post-rebase
      
      * Properly use state
      
      * Write doc
      
      * Fix doc
      
      * More math
      
      * Add model to README, dummies and clean config
      
      * Fix init
      
      * multiple fixes:
      
      - fix common tests
      - fix configuraion default values
      - add CI test for checking state computation
      - fix some CI tests
      
      * correct tokenizer
      
      * some tweaks
      
      - fix config docstring
      - fix failing tests
      
      * fix CI tests
      
      - add output_attention / output_hidden_states
      - override test_initialization
      - fix failing CIs
      
      * fix conversion script
      
      - fix sharded case
      - add new arguments
      
      * add slow tests + more fixes on conversion script
      
      * add another test
      
      * final fixes
      
      * change single name variable
      
      * add mock attention mask for pipeline to work
      
      * correct eos token id
      
      * fix nits
      
      * add checkpoints
      
      * Apply suggestions from code review
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * add `tie_word_embeddings` in docstring
      
      * change tensor name
      
      * fix final nits
      
      * Trigger CI
      
      ---------
      Co-authored-by: default avataryounesbelkada <younesbelkada@gmail.com>
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      b4d4d6fe
  3. 28 Apr, 2023 1 commit
  4. 27 Apr, 2023 1 commit
  5. 23 Apr, 2023 1 commit
  6. 20 Apr, 2023 1 commit
  7. 19 Apr, 2023 2 commits
    • Arthur's avatar
      Add Segment Anything Model (SAM) (#22654) · 474bf508
      Arthur authored
      
      
      * initial commit
      
      * keys match
      
      * update, fix conversion
      
      * fixes, inference working
      
      * fix
      
      * more fixes
      
      * more fixes
      
      * clean up
      
      * more clean up
      
      * fix copies and add convext copied layer norm
      
      * stash
      
      * pretty big upfate
      
      * cleaning
      
      * more cleaning
      
      * fixup stuffs
      
      * fix copies
      
      * fix iinit
      
      * update test removing tokenizer
      
      * nits
      
      * add pretrained
      
      * more nits
      
      * remove tracking of pipeline
      
      * few fixes
      
      * update san and conversion script
      
      * fix mask decoder and prompt encoder conversion
      
      * fixes
      
      * small update
      
      * fix order
      
      * fix
      
      * fix image embeddings
      
      * nites
      
      * few fixes
      
      * fix logits
      
      * clean up
      
      * fixes boxes inference
      
      * v1 AMG
      
      * clean up
      
      * some clean up
      
      * multi points support
      
      * amg working
      
      * fixup
      
      * clean up
      
      * readme
      
      * update toctree
      
      * fix type hint
      
      * multiple fixes
      
      * fixup
      
      * fixes
      
      * updates
      
      * updates
      
      * more tests
      
      * few fixes
      
      * change to `SamForMaskGeneration`
      
      * doc
      
      * fixup
      
      * fix more tests
      
      * multiple fixes
      
      * fix CI tests
      
      * refactor processor
      
      * renamings
      
      * draft the pipeline
      
      * refactor
      
      * fix tests
      
      * fix test
      
      * few cleanings
      
      * fix test
      
      * edit pipelien support chunking
      
      * udate
      
      * add slow tests
      
      * fix nit
      
      * fixup
      
      * fix nit
      
      * current chunk pipleine
      
      * cast boxes in fp32
      
      * nit
      
      * current updates
      
      * piepleine works
      
      * fixup
      
      * clean up config
      
      * fix slow tests
      
      * fix slow tests
      
      * clean up
      
      * update doc and pipeline
      
      * adds more slow tests
      
      * fix slow tests
      
      * cleaning
      
      * tests pass
      
      * add docstring
      
      * fix copies
      
      * clean up
      
      * support batch of images
      
      * style
      
      * dummy is needed, add tests
      
      * fix slow tests
      
      * fix CI
      
      * update
      
      * adds more tests
      
      * fixes
      
      * fixes
      
      * fixup
      
      * fixes
      
      * few fixes
      
      * filter
      
      * few fixes
      
      * some refactor
      
      * touches finales
      
      * fix
      
      * style
      
      * remove pipeline files
      
      * fixes nits
      
      * revert pipeline changes
      
      * fix test
      
      * fixup
      
      * remove automodel for automatic mask generation
      
      * fix failing torch tests
      
      * update mdx
      
      * revert removal of `MODEL_FOR_AUTOMATIC_MASK_GENERATION_MAPPING`
      
      * update sam config based on review
      Co-authored-by: default avataramyeroberts <aeroberts4444@gmail.com>
      Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
      
      * update low_resolution_masks -> pred_masks
      inti ln with layer_norm_eps
      add_decomposed_rel_pos doc
      forward doc of SamForMaskGeneration
      
      * update processor docstring
      
      * remove image processor import empty
      
      * update for testing
      
      * output vision hidden states + clean recomm
      also test all iou values
      
      * fixup
      
      * fixup
      
      * remove unused
      
      * Update src/transformers/models/sam/modeling_sam.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/models/sam/image_processing_sam.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * nits
      
      * fix
      
      * fix CI tests and slow tests
      
      * replace with Amy's processor
      
      * clearer docstring
      
      * add `SamVisionNeck`
      
      * refactor - all CI tests should pass
      
      * fix broken import on Gcolab
      
      * few fixes here and there
      
      * fix another bug
      
      * fix more bugs
      
      * update and merge
      
      * correct ckpt
      
      * address comments
      
      * add tips
      
      * revert
      
      * fix docstring
      
      * replace with `SamModel`
      
      * make fixup
      
      * add support for bathed images and batch ed points
      
      * make fixup this time, really
      
      * make fixup again and again
      
      * few fixes here and there, this should be the touche finale
      
      * Update docs/source/en/model_doc/sam.mdx
      
      * fixup
      
      * correct checkpoints
      
      * correct name
      
      * rm unneeded file
      
      * add notebook
      
      ---------
      Co-authored-by: default avataryounesbelkada <younesbelkada@gmail.com>
      Co-authored-by: default avataramyeroberts <aeroberts4444@gmail.com>
      Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      474bf508
    • amyeroberts's avatar
      Remove 'main' from doc links (#22860) · 5f97bbc1
      amyeroberts authored
      5f97bbc1
  8. 13 Apr, 2023 1 commit
  9. 12 Apr, 2023 1 commit
    • pioliverse's avatar
      add model resources for CPMAnt (new) (#20906) · 523ca4e0
      pioliverse authored
      
      
      * resolve conflicts
      
      * rebase and make style
      
      * test
      
      * test
      
      * test
      
      * rebase and make style
      
      * rebase and make style
      
      * tests
      
      * tests
      
      * rewrite some functions
      
      * rebase and make style
      
      * fix load_tf_weights_in_cpmant
      
      * reformat some unrelated files
      
      * upgrade quality
      
      * fix some bugs & docstring
      
      * add models and tests
      
      * solve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * tests
      
      * resolve conflicts
      
      * resolve conflicts
      
      * fix load_tf_weights_in_cpmant
      
      * reformat some unrelated files
      
      * upgrade quality
      
      * fix some bugs & docstring
      
      * save resolution
      
      * make style
      
      * delete redefinition code
      
      * reformat function
      
      * reformat
      
      * resolve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * tests
      
      * resolve conflicts
      
      * resolve conflicts
      
      * fix load_tf_weights_in_cpmant
      
      * reformat some unrelated files
      
      * upgrade quality
      
      * resolve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * resolve conflicts
      
      * fix load_tf_weights_in_cpmant
      
      * reformat some unrelated files
      
      * upgrade quality
      
      * resolve conflicts
      
      * make style
      
      * fix bugs and refactor
      
      * modify docstrings and make style
      
      * unify import format in __init__.py
      
      * fix import-altclp bug
      
      * fix copies to update index.md
      
      * fix unused config parameters
      
      * fix unused config parameters
      
      * fix unused config parameters
      
      * update README_ja.md
      
      * dummy commit for unit test
      
      * fix attention mask
      
      * add CPMAntTokenizer&-Fast to auto-mapping
      
      * drop redundant changes in README_ko
      
      * fix  defaults in docstring
      
      * fix use_cache and some docstring
      
      * add missing args in tokenizer
      
      * modify tester inheritance
      
      * add is_jieba_available
      
      * fix some bugs
      
      * make style and fix-copies
      
      * add doctests
      
      * skip integration tests
      
      * add is_jieba_available
      
      * fix bugs in common tests
      
      * adjust docstrings and make style
      
      * add argument docstring
      
      * adjust code to some specifications
      
      * make style and fix-copies
      
      * add fast tokenization test
      
      * dummy commit for unit test
      
      * dummy commit for unit test
      
      * dummy commit for unit test
      
      * normalize some comments and names
      
      * Bert->CPMAnt
      
      * camel names and drop redundant codes
      
      * make style and fix-coies
      
      * add CpmTokenizerFast _import_structure
      
      * drop cpmanttokenizerfast in model_doc
      
      * fix some problems
      
      * fix CPMAnt tokenization for common test
      
      * make style and fixup
      
      * fix copies and fixup
      
      * fix bugs in tokenization test
      
      * dummy commit for connection failure in unittest
      
      * fix copies
      
      * drop trailing comma
      
      * fix decorator in tests
      
      * dummy commit for connection failure in unittest
      
      ---------
      Co-authored-by: default avatarGong Baitao <gongbaitao11@gmail.com>
      523ca4e0
  10. 10 Apr, 2023 1 commit
    • Joel Lamy-Poirier's avatar
      Add GPTBigCode model (Optimized GPT2 with MQA from Santacoder & BigCode) (#22575) · e0921c6b
      Joel Lamy-Poirier authored
      
      
      * Add model with cli tool
      
      * Remove unwanted stuff
      
      * Add new code
      
      * Remove inference runner
      
      * Style
      
      * Fix checks
      
      * Test updates
      
      * make fixup
      
      * fix docs
      
      * fix doc
      
      * fix test
      
      * hopefully fix pipeline tests
      
      * refactor
      
      * fix CIs
      
      * add comment
      
      * rename to `GPTBigCodeForCausalLM`
      
      * correct readme
      
      * make fixup + docs
      
      * make fixup
      
      * fixes
      
      * fixes
      
      * Remove pruning
      
      * Remove import
      
      * Doc updates
      
      * More pruning removal
      
      * Combine copies
      
      * Single MQA implementation, remove kv cache pre-allocation and padding
      
      * Update doc
      
      * Revert refactor to match gpt2 style
      
      * Merge back key and value caches, fix some type hints
      
      * Update doc
      
      * Fix position ids pith padding (PR 21080)
      
      * Add conversion script temporarily
      
      * Update conversion script
      
      * Remove checkpoint conversion
      
      * New model
      
      * Fix MQA test
      
      * Fix copies
      
      * try fix tests
      
      * FIX TEST!!
      
      * remove  `DoubleHeadsModel`
      
      * add MQA tests
      
      * add slow tests
      
      * clean up
      
      * add CPU checker
      
      * final fixes
      
      * fixes
      
      - fix GPU issue
      - fixed slow tests
      - skip disk offload
      
      * fix final issue
      
      * Simplify and comment baddbmm fix
      
      * Remove unnecessary code
      
      * Transpose tweaks
      
      * Use beta=1 on cpu, improve tests
      
      ---------
      Co-authored-by: default avataryounesbelkada <younesbelkada@gmail.com>
      e0921c6b
  11. 05 Apr, 2023 1 commit
  12. 27 Mar, 2023 1 commit
    • Arthur's avatar
      [WIP]`NLLB-MoE` Adds the moe model (#22024) · 19ade242
      Arthur authored
      * Initial commit
      
      * update modeling code
      
      * update doc
      
      * add functions necessary
      
      * fix impotrs
      
      * revert changes
      
      * fixup
      
      * more styling to get going
      
      * remove standalone encoder
      
      * update code
      
      * styling
      
      * fix config and model
      
      * update code and some refactoring
      
      * make more tests pass
      
      * Adding NLLB-200 - MoE - 54.5B for no language left behind
      Fixes #21300
      
      * fix mor common tests
      
      * styke
      
      * update testing file
      
      * update
      
      * update
      
      * Router2 doc
      
      * update check config with sparse layer
      
      * add dummy router
      
      * update current conversion script
      
      * create on the fly conversion script
      
      * Fixup
      
      * style
      
      * style 2
      
      * fix empty return
      
      * fix return
      
      * Update default config sparse layers
      
      * easier to create sparse layers
      
      * update
      
      * update conversion script
      
      * update modeling
      
      * add to toctree
      
      * styling
      
      * make ruff happy
      
      * update docstring
      
      * update conversion script
      
      * update, will break tests but impelemting top2
      
      * update
      
      * local groups are supported here
      
      * ️ Support for local groups is now removed ️
      
      This is because it has to work with model parallelism that we do not support
      
      * finish simplificaiton
      
      * Fix forward
      
      * style
      
      * fixup
      
      * Update modelling and test, refactoring
      
      * update tests
      
      * remove final layer)norm as it is done in the FF
      
      * routing works! Logits test added
      
      * nit in test
      
      * remove top1router
      
      * style
      
      * make sure sparse are tested. Had to change route_tokens a liottle bit
      
      * add support for unslip models when converting
      
      * fixup
      
      * style
      
      * update test s
      
      * update test
      
      * REFACTOR
      
      * encoder outputs match!
      
      * style
      
      * update testing
      
      * 🎉encoder and decoder logits match 🎉
      
      
      
      * styleing
      
      * update tests
      
      * cleanup tests
      
      * fix router test and CIs
      
      * cleanup
      
      * cleanup test styling
      
      * fix tests
      
      * Finally the generation tests match!
      
      * cleanup
      
      * update test
      
      * style testing file
      
      * remove script
      
      * cleanup
      
      * more cleanup
      
      * nits
      
      * update
      
      * NLLB tokenizer is wrong and will be fixed soon
      
      * use LongTensors
      
      * update tests
      
      * revert some small changes
      
      * fix second expert sampling and batch prioritized routing
      
      * update tests
      
      * finish last tests
      
      * make ruff happy
      
      * update
      
      * ruff again
      
      * style
      
      * Update docs/source/en/model_doc/nllb-moe.mdx
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Updates based on review
      
      * style and fix import issue
      
      * nit
      
      * more nits
      
      * cleanup
      
      * styling
      
      * update test_seconde_expert_policy
      
      * fix name
      
      * last nit on the markdown examples
      
      ---------
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      19ade242
  13. 24 Mar, 2023 1 commit
    • Mitch Naylor's avatar
      Add Mega: Moving Average Equipped Gated Attention (#21766) · 57f25f4b
      Mitch Naylor authored
      
      
      * add mega file structure and plain pytorch version of mega source code
      
      * added config class with old naming conventions
      
      * filled in mega documentation
      
      * added config class and embeddings with optional token types
      
      * updated notes
      
      * starting the conversion process, deleted intermediate and added use_cache back to config
      
      * renamed config attributes in modeling_mega.py
      
      * checkpointing before refactoring incremental decoding functions
      
      * removed stateful incremental key/values for EMA and self-attention
      
      * refactored MovingAverageGatedAttention to remove stateful k/v history and use unified attention mask
      
      * MovingAverageGatedAttention works with incremental decoding + past values, added sequence length enforcement
      
      * more comments in MovingAverageGatedAttention + checkpointing before GatedCrossAttention
      
      * bug fix in attention mask handling in MovingAverageGatedAttention
      
      * removed incremental state from GatedCrossAttention and removed IncrementalState class
      
      * finished gated cross attention and got MegaLayer working
      
      * fixed causal masking in mega decoder
      
      * fixed how padding and causal masks are passed through MegaLayer with and without k/v caching
      
      * finished MegaModel; tested with encoder, decoder-only, and cross-attention type inputs; started work on downstream classes; removed mentions of position_ids
      
      * added optional dense hidden layer for masked and causal LM classes
      
      * docstring updates in MultiHeadEMA and GatedCrossAttention, removed unnecessary inputs in cross-attention
      
      * removed before_attn_fn in Mega class and updated docstrings and comments up to there
      
      * bug fix in MovingAverageGatedAttention masking
      
      * working conversion of MLM checkpoint in scratchpad script -- perfect matches
      
      * moved arg for hidden dense layer in LM head to config; discovered issue where from_pretrained is renaming gamma and beta parameters
      
      * renamed gamma and beta parameters to avoid HF renaming when loading from checkpoint
      
      * finished checkpoint conversion script
      
      * cleanup old class in mega config script
      
      * removed 'copied from' statements and passing integration tests
      
      * added num_attention_heads=1 to config for integration compatibility, decoder tests working, generation tests failing
      
      * fixed tuple output of megamodel
      
      * all common tests passing after fixing issues in decoder, gradient retention, and initialization
      
      * added mega-specific tests, ready for more documentation and style checks
      
      * updated docstrings; checkpoint before style fixes
      
      * style and quality checks, fixed initialization problem in float_tensor, ready for PR
      
      * added mega to toctree
      
      * removed unnecessary arg in megaconfig
      
      * removed unused arg and fixed code samples with leftover roberta models
      
      * Apply suggestions from code review
      
      Applied all suggestions except the one renaming a class, as I'll need to update that througout
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * fixed issue where .view breaks batch dimension, conversion script fixed with absolute imports, updated readme with Mega->MEGA
      
      * removed asserts in Mega code, renamed sequencenorm, gatedcrossattention, and NFFN, replaced get_activation_fn with ACTFN, and added sequencenorm to layer norms
      
      * reformatted .forward() docstrings to match style and removed unused mask input in cross-attention
      
      * removed all reset_parameters() methods and rolled into MegaPreTrainedModel._init_weights()
      
      * renamed all single-letter variables and improved readability in tensor size comments, Mega->MEGA in 2 documentation files
      
      * variable names in NFFN
      
      * manual Mega->MEGA changes in docs
      
      * Mega->MEGA in config auto
      
      * style and quality fixes
      
      * Apply suggestions from code review
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * renamed parameters and variables with confusing names, added copied from statements, moved fft conv to its own method, other cleanup from PR comments
      
      * commit before dealing with merge conflicts
      
      * made new attention activation functions available in ACT2FN and added generation test from OPT
      
      * style and quality in activations and tests
      
      * documentation fixes, renaming variables in dropout and rotary positions, used built-in causal masking, encoders->layers in MegaModel, moved comments into docstrings
      
      * style and quality fixes after latest updates, before rotary position ids
      
      * causal mask in MegaBlock docstring + added missing device passing
      
      * Apply suggestions from code review
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * Update README.md
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * added Mega prefixes where missing, reverted MegaSequenceNorm to if-else, other module renaming requested in PR
      
      * style and quality fixes + readme updates pointing to main
      
      ---------
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      57f25f4b
  14. 22 Mar, 2023 1 commit
  15. 16 Mar, 2023 1 commit
    • Jason Phang's avatar
      LLaMA Implementation (#21955) · 0041be5b
      Jason Phang authored
      
      
      * LLaMA
      
      * sharding and docs
      
      * tweak
      
      * black
      
      * inits
      
      * ruff
      
      * LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP
      
      * init
      
      * no checkpoint
      
      * docs
      
      * ruff
      
      * type_vocab_size
      
      * tokenizer fixes
      
      * tokenizer fixes
      
      * Update tokenization_llama.py
      
      * Update tokenization_llama.py
      
      * Update configuration_llama.py
      
      * Update modeling_llama.py
      
      * tokenizer add_bos by default
      
      * licenses
      
      * remove decoder
      
      * norms and mlp
      
      * rope overhaul
      
      * tweaks
      
      * black
      
      * mention OPT implementation
      
      * off-by-one naming
      
      * typo
      
      * fix
      
      * tokenization fix and slicing bug
      
      * padding config
      
      * cleanup
      
      * black
      
      * update tests
      
      * undo typo
      
      * fix vocab caching logic
      
      * ruff
      
      * docbuilder
      
      * attn fix from BlackSamorez
      
      * initial feedback
      
      * typo
      
      * docs
      
      * llama case
      
      * llama case
      
      * load checkpoint docs
      
      * comment about tokenizer
      
      * tokenizer defaults
      
      * clear past_key_values if use_cache=False
      
      * last tweaks
      
      * last tweaks
      
      * last tweaks
      
      * last tweaks
      
      ---------
      Co-authored-by: default avatarStella Biderman <stellabiderman@gmail.com>
      0041be5b
  16. 14 Mar, 2023 2 commits
  17. 13 Mar, 2023 2 commits
    • Sylvain Gugger's avatar
      Fix doc link for MGP-STR (#22138) · 6cb5132a
      Sylvain Gugger authored
      6cb5132a
    • wangpeng's avatar
      add new model of MGP-STR (#21418) · 102b5ff4
      wangpeng authored
      
      
      * add new model of MGP-STR
      
      * fix the check failings
      
      * remove torch and numpy from mgp_tokenization
      
      * remove unused import from modeling_mgp_str
      
      * add test_processing_mgp_str
      
      * rm test_processing_mgp_str.py
      
      * add test_processing_mgp_str
      
      * add test_processing_mgp_str
      
      * add test_processing_mgp_str
      
      * rm test_processing_mgp_str and add softmax outs to model
      
      * rm test_processing_mgp_str and add softmax outs to model
      
      * rewrite the code of mgp-str according to PR suggestions
      
      * rewrite the code of mgp-str according to PR suggestions
      
      * add new model of MGP-STR
      
      * fix the check failings
      
      * remove torch and numpy from mgp_tokenization
      
      * remove unused import from modeling_mgp_str
      
      * add test_processing_mgp_str
      
      * rm test_processing_mgp_str.py
      
      * add test_processing_mgp_str
      
      * add test_processing_mgp_str
      
      * add test_processing_mgp_str
      
      * rm test_processing_mgp_str and add softmax outs to model
      
      * rewrite the code of mgp-str according to PR suggestions
      
      * rewrite the code of mgp-str according to PR suggestions
      
      * remove representation_size from MGPSTRConfig
      
      * reformat configuration_mgp_str.py
      
      * format test_processor_mgp_str.py
      
      * add test for tokenizer and complete model/processer test and model file
      
      * rm Unnecessary tupple in modeling_mgp_str
      
      * reduce hidden_size/layers/label_size in test_model
      
      * add integration tests and change MGPSTR to Mgpstr
      
      * add test for logit values
      
      * reformat test model file
      
      ---------
      Co-authored-by: default avataryue kun <yuekun.wp@alibaba-inc.com>
      102b5ff4
  18. 07 Mar, 2023 1 commit
    • Eli Simhayev's avatar
      [Time-Series] informer model (#21099) · 8abe4930
      Eli Simhayev authored
      * added informer to gitignore
      
      * added informer to gitignore
      
      * WIP informer2020
      
      * added checking that instantiate works
      
      * added config using gluonTS by kashif
      
      * WIP config
      
      * adding informeConfig. need to remove FeatureEmbedder
      
      * done InformerConfig, but need to change the names
      
      * Done informer model init. working on enc-dec
      
      * added things to address, after reading again enc-dec in the paper
      
      * done modeling - checking initialization work
      
      * added informer to gitignore
      
      * WIP informer2020
      
      * added checking that instantiate works
      
      * added config using gluonTS by kashif
      
      * WIP config
      
      * adding informeConfig. need to remove FeatureEmbedder
      
      * done InformerConfig, but need to change the names
      
      * Done informer model init. working on enc-dec
      
      * added things to address, after reading again enc-dec in the paper
      
      * done modeling - checking initialization work
      
      * moved enc-dec init to InformerEncoder/Decoder init
      
      * added 'init_std' to config, now model init works!
      
      * WIP conversion script, and added code sources
      
      * WIP conversion script: loading original informer pth works
      
      * WIP conversion script: change defaults in the config
      
      * WIP conversion script: supporting Informer input embedding
      
      * WIP conversion script: added parameters for the informer embed
      
      * WIP conversion script: change dim_feedforward=2048
      
      * WIP conversion script: remove unused args for loading checkpoint
      
      * just cleaning up
      
      * DataEmbedding removed, after thinking with Kashif
      
      * working on forward pass
      
      * WIP forward pass: trying to establish working batch for forward pass
      
      * cleaning and finalizing
      
      * adding HF names and docs
      
      * init after cleaning works
      
      * WIP in tests
      
      * added docs for the informer specific args
      
      * fix style
      
      * undo change
      
      * cleaning informer, now need to work only enc-dec
      
      * initial enc-dec classes
      
      * added encoder and decoder
      
      * added todo
      
      * add todos for conv_layers
      
      * added decoder docs from vanilla
      
      * added encoder docs from vanilla
      
      * remove encoder decoder from the original informer
      
      * removed AttentionLayer from the original paper
      
      * removed TriangularCausalMask, same as decoder_attention_mask
      
      * initial sparse attention
      
      * use conv_layers
      
      * fixed test_config test
      
      * fix parenthesis when itearting zip(layers, conv_layers)
      
      * error found in prob attention, added sizes as comments
      
      * fix sizes
      
      * added proposal for q_reduce indexing, and remove unused
      
      * WIP ProbMask, and changed factor=2 for testing
      
      * remove unused libs for this PR for creating the env
      
      * fix checking the attn_weights.size() after bmm
      
      * Q_reduce: changed from torch.gather to simple slicing
      
      * WIP calculate final attn_output
      
      * finish adding v_aggregated, attn_output ready
      
      * changed tgt_len to u in attention_mask, need to fix the size error
      
      * comment attention_mask for encoder, and fix if cond for v_agg
      
      * added ProbMask support (wip), removed old original code
      
      * finished ProbMask 😃
      
      
      
      * Revert "remove unused libs for this PR for creating the env"
      
      This reverts commit 11a081e09e92771e51a5d2758d53a9afb59547f0.
      
      * fixes
      
      * make style
      
      * fix initial tests
      
      * fix more tests
      
      * dry
      
      * make style
      
      * remove unused files
      
      * style
      
      * added integration tests
      
      * fix num_static_real_features
      
      * fix header
      
      * remove unused function
      
      * fix example
      
      * fix docs
      
      * Update src/transformers/models/informer/configuration_informer.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update src/transformers/models/informer/modeling_informer.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update src/transformers/models/informer/configuration_informer.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update src/transformers/models/informer/configuration_informer.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update src/transformers/models/informer/configuration_informer.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update src/transformers/models/informer/configuration_informer.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * fixes for reviewer
      
      * use prediction_length from model
      
      * fix style
      
      * fixed informer.mdx
      
      * added to index
      
      * updated readme
      
      * undo
      
      * make fix-copies
      
      * typo
      
      * fix copy
      
      * added Informer to toctree
      
      * in order
      
      * fixed comments
      
      * remove unneeded new lines in docs
      
      * make static real and cat optional
      
      * fix use of distil conv layers
      
      * fixed integration test
      
      * added checkpoint for convlayer
      
      * make fix-copies
      
      * updated from time series model
      
      * make fix-copies
      
      * copy decoder
      
      * fix unit tests
      
      * updated scaling config
      
      * fix integration tests
      
      * IGNORE_NON_TESTED
      
      * IGNORE_NON_AUTO_CONFIGURED
      
      * IGNORE_NON_AUTO_CONFIGURED
      
      * updated check configs
      
      * fix formatting
      
      * undo change from time series
      
      * prediction_length should not be None
      
      * aliign with the blog: prettify ProbSparse and change attention_factor  to sampling_factor
      
      * make style
      
      * make fix-copies
      
      * niels CR: update contributed by
      
      * niels CR: update configuration_informer.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * niels CR: update kashif -> huggingface
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * niels CR: `sampling_factor` only relevant when `attention_type`=prob
      
      * make style
      
      * fixed U_part: added multiplication by `L_Q`
      
      * fixed bug: remove `is not None` from `if config.distil`
      
      * fixed test: `decoder_seq_length` to `encoder_seq_length` in cross_attentions check
      
      * fix integration tests
      
      * updated model hub
      
      * do not shift as in training
      
      * undo
      
      * fix make-copies
      
      * make fix-copies
      
      * added `if prediction_length is None`
      
      * changed `ProbSparseAttention` to `InformerProbSparseAttention`
      
      * changed `V_sum` -> `v_mean_dim_time`
      
      * changed `ConvLayer` to `InformerConvLayer` and fixed `super()`
      
      * TimeSeriesTansformer->Informer in decoder's Copied from
      
      * more descriptive in ProbSparse
      
      * make style
      
      * fix coped from
      
      * Revert "added `if prediction_length is None`"
      
      This reverts commit b4cbddfa05e3bd739b79569cd3c3b89e316f2451.
      
      * fixed indent
      
      * use InformerSinusoidalPositionalEmbedding
      
      * make fix-style
      
      * fix from #21860
      
      * fix name
      
      * make fix-copies
      
      * use time series utils
      
      * fix dec num_heads
      
      * docstring
      
      * added time series util doc
      
      * _import_structure
      
      * formatting
      
      * changes from review
      
      * make style
      
      * fix docs
      
      * fix doc
      
      * removed NegativeLogLikelihood
      
      ---------
      Co-authored-by: default avatarKashif Rasul <kashif.rasul@gmail.com>
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      8abe4930
  19. 03 Mar, 2023 2 commits
  20. 01 Mar, 2023 1 commit
    • Alara Dirik's avatar
      Add ALIGN to transformers (#21741) · 269b0549
      Alara Dirik authored
      Adds the ALIGN model to transformers. ALIGN is introduced in "Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision" by Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V. Le, Yunhsuan Sung, Zhen Li, Tom Duerig.
      269b0549
  21. 20 Feb, 2023 2 commits
    • Alara Dirik's avatar
      Add EfficientNet (#21563) · 49ab1623
      Alara Dirik authored
      * Add EfficientNet to transformers
      49ab1623
    • tanreinama's avatar
      add GPTSAN model (reopen) (#21291) · f56174ac
      tanreinama authored
      * add GPTSAN-Japanese
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN (update for review)
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * fix typo in comment text
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * add GPTSAN
      
      * fix document and comments
      
      * fix class name GPTSAN->GPTSan
      
      * fix import and test for tokenizer
      f56174ac
  22. 16 Feb, 2023 1 commit
    • Arthur's avatar
      [CLAP] Add CLAP to the library (#21370) · c236a621
      Arthur authored
      
      
      * add model like clip
      
      * update
      
      * text model ok
      
      * clap text works
      
      * some refactor
      
      - `CLAPVision` to `CLAPAudio`
      - refactor kwargs of audio modules
      
      * more refactor
      
      * more refactor
      
      * more refactor
      
      * correct fusion
      
      * more refactor
      
      * new modules
      
      * add basic processor
      
      * fixup
      
      * remove whisper copioed from
      
      * audio logits match
      
      * add doc
      
      * correct filters mel and add maxlength
      
      * style
      
      * few fixes
      
      * forward passes
      
      * fixup
      
      * fixup
      
      * some clean up
      
      * remove mels form the dictionnary
      
      * pad after the repeat
      
      * update padding when dsmaller
      
      * fix padding
      
      * style
      
      * use swin patch merging
      
      * use copied from swin
      
      * processor with any tokenizer
      
      * more copied from
      
      * some clean up
      
      * more refactor
      
      * fix mel when rand_trunc
      
      * style
      
      * remove unused imports
      
      * update processing
      
      * remove image processing tests
      
      * add testing fiel
      
      * fixmodeling issues
      
      * replace with `is_longer`
      
      * clap in serialization
      
      * more refactor
      
      * `make fixup`
      
      * make fixup
      
      * fix feature extractor
      
      * update test feature extractor
      
      * `make fixup`
      
      * clean up config
      
      * more clean up
      
      * more cleanup
      
      * update tests
      
      * refactor tests and inits
      
      * removeCLAP vision config
      
      * remove CLAP from image procssing auto and dummy vision objects
      
      * update inits
      
      * style
      
      * re order classes in modeling clap
      
      * Use roberta tokenizer as the other weights are not open sourced
      
      * small cleaup
      
      * remove tokenization CLAP
      
      * processor tokenizr is roberta
      
      * update feature extraction doc
      
      * remove vclap from model zero shot
      
      * update f_min and f_max to frequency_xx
      
      * some changes
      
      - fix modeling keys
      - add `is_longer` in the forward pass
      - make fixup
      
      * make fixup
      
      * consistent behavior ebtween rand_crop and fusion
      
      * add numpy resize and bilinear and documentation
      
      * move resizing to image utils
      
      * clean feature extraction
      
      * import resize from correct file
      
      * resize in image transforms
      
      * update
      
      * style
      
      * style
      
      * nit
      
      * remove unused arguments form the feature extractor
      
      * style
      
      * few fixes + make fixup
      
      * oops
      
      * fix more tests
      
      * add zero shot audio classification pipeline
      
      * update zeroshot classification pipeline
      
      * fixup
      
      * fix copies
      
      * all CI tests pass
      
      * make fixup + fix docs
      
      * fix docs
      
      * fix docs
      
      * update tests pip;eline
      
      * update zero shot pipeline
      
      * update feature extraction clap
      
      * update tokenization auto
      
      * use nested simplify
      
      * update pipeline tests
      
      * Apply suggestions from code review
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * split in two lines
      
      * fixes
      
      * refactor
      
      * clean up
      
      * add integration tests
      
      * update config docstring
      
      * style
      
      * update processor
      
      * fix processor test
      
      * fix feat extractor tests
      
      * update docs
      
      * Apply suggestions from code review
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * fix readmes
      
      * fix tips
      
      * Update src/transformers/models/auto/configuration_auto.py
      
      * update doc and remove todo -> properly explained
      
      * fix idx and typo
      
      * typoe
      
      * cleanup config
      
      * cleanup tests, styles and doc
      
      * ignore docstyle on image transform
      
      * add conversion script
      
      * remove the `clap` indx in favor of `CLAP`
      
      * update __init
      
      * nits
      
      * Update src/transformers/pipelines/__init__.py
      
      * fix bug
      
      * clarifiy config
      
      * fix copy
      
      * fix init
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * fix model output
      
      * fix comment
      
      * make fixup
      
      * make fixup
      
      * rename to `Clap`
      
      * replace to `Clap`
      
      * replace to `Clap`
      
      * repo consistency
      
      * again repo-consistency
      
      * make fixup
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>
      
      * add config
      
      * changes
      
      * update conversion
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>
      
      * remove unused function
      
      * update based on code reviews
      
      * style
      
      * more comments
      
      * cleanup
      
      * clean up
      
      * style
      
      * apply suggestions
      
      * Empty commit
      
      * pipeline will be added in a different PR
      
      * update calls to audio utils functions
      
      * update pipeline init
      
      * style
      
      * style
      
      * styling again
      
      * use pad
      
      * fix repo-consistency
      
      * update utils and add doc for audio utils
      
      * clean up resize by using torch. update inits accordingly
      
      * style
      
      * CLap's  tokenizer is RobertA
      
      * add audio utils to internal toctreee
      
      * update totctree
      
      * style
      
      * update documentation and normalize naming accross audio utils and feature extraction clap
      
      * style
      
      * clean up
      
      * update doc and typos
      
      * fix doctest
      
      * update modelin code, got rid of a lot of reshaping
      
      * style on added doc audio utils
      
      * update modeling clap
      
      * style
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * docstringvariables with CLAP
      
      * rename key
      
      * update modeling CLAP
      
      * update audio utils docstring
      
      * update processing clap
      
      * fix readmes
      
      * fix toctree
      
      * udpate configuration clap
      
      * fix init
      
      * make fixup
      
      * fix
      
      * fix
      
      * update naming
      
      * update
      
      * update checkpoint path
      
      * Apply suggestions from code review
      
      * Major refactoring
      
      * Update src/transformers/models/clap/configuration_clap.py
      
      * merge
      
      ---------
      Co-authored-by: default avataryounesbelkada <younesbelkada@gmail.com>
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarSanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>
      c236a621
  23. 15 Feb, 2023 2 commits
  24. 10 Feb, 2023 1 commit
    • Jannis Vamvas's avatar
      Add X-MOD (#20939) · b0d539cc
      Jannis Vamvas authored
      
      
      * Add X-MOD to Readme
      
      * Add documentation for X-MOD
      
      * Implement X-MOD
      
      * Fix formatting of X-MOD docs
      
      * Change signature of X-MOD forward methods to use lang_ids
      
      * Minor changes
      
      * Rebase with main and run make fix-copies
      
      * Make suggested changes to docstrings
      
      * Improve code readability
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      
      * Fix code style
      
      * Conversion script: Remove asserts and type annotations
      
      * Remove _TOKENIZER_FOR_DOC
      
      * XMOD -> Xmod
      
      * Update copyright note
      
      * Fix doctests
      
      * Fix docstring
      
      * Add integration test for FillMaskPipeline
      
      * Revert "Add integration test for FillMaskPipeline"
      
      This reverts commit 4381eb3b1d0f5d85785f89caba83928e6efa6d1f.
      
      * Add end-to-end integration test for mask fill
      
      * make style
      
      * Rebase with main and make fix-copies
      
      ---------
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      b0d539cc
  25. 09 Feb, 2023 1 commit
    • NielsRogge's avatar
      Add BLIP-2 (#21441) · d7f1e7c0
      NielsRogge authored
      
      
      * First draft
      
      * More improvements
      
      * More improvements
      
      * Improve conversion script
      
      * Convert all weights
      
      * Make forward pass work
      
      * Make logits match
      
      * More improvements
      
      * More improvements
      
      * More improvements
      
      * Use get_input_embeddings
      
      * Improve some more
      
      * Improve model tests
      
      * Improve model tests
      
      * More improvements
      
      * Fix processor
      
      * Update files
      
      * Update prepare_inputs_for_generation
      
      * More improvements
      
      * Fix copies
      
      * More fixes
      
      * Make fixup
      
      * More improvements
      
      * Add support for seq2seq language model
      
      * More improvements
      
      * Fix test
      
      * More improvements
      
      * Improve conversion script
      
      * Remove some todo's
      
      * Fix README's
      
      * Improve conversion script
      
      * Fix generation
      
      * Fix style and remove Blip2Model
      
      * Fix model outputs
      
      * More improvements
      
      * Set eos_token_id in config
      
      * Fix quality
      
      * Small improvements
      
      * Add processor tests
      
      * More improvements
      
      * Apply suggestions
      
      * Apply suggestions
      
      * Add integration test
      
      * Update image URL
      
      * Add integration test
      
      * Fix model_type
      
      * Update style
      
      * Improve docs
      
      * Add doc tests
      
      * Fix copies
      
      * Remove tests which are passing
      
      * Improve some more
      
      * Add tests for seq2seq language models
      
      * Minor fix
      
      * Convert more checkpoints
      
      * finalize CI
      
      * Fix blip and blip2 processors
      
      * add `accelerate` support for `blip2`
      
      * clean up
      
      * make style
      
      * Update conversion script
      
      * Update conversion script some more
      
      * Update organization
      
      * revert toc file
      
      * add blip-2 to toc file
      
      * Some more improvements
      
      * Fix docstring
      
      * Improve docs
      
      ---------
      Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
      Co-authored-by: default avataryounesbelkada <younesbelkada@gmail.com>
      d7f1e7c0
  26. 07 Feb, 2023 1 commit
    • Stefan Schweter's avatar
      Add XLM-V to Model Doc (#21498) · 7e51a441
      Stefan Schweter authored
      * doc: introduce new section for XLM-V model
      
      * doc: mention more details for XLM-V integration
      
      * docs: paper abstract in italics, model identifier for base model added
      
      * doc: mention new XLM-V support
      
      * auto: add XLM-V mapping
      
      * doc: run make fix-copies ;)
      7e51a441
  27. 03 Feb, 2023 1 commit
    • Matthijs Hollemans's avatar
      [WIP] add SpeechT5 model (#18922) · e4bacf66
      Matthijs Hollemans authored
      * make SpeechT5 model by copying Wav2Vec2
      
      * add paper to docs
      
      * whoops added docs in wrong file
      
      * remove SpeechT5Tokenizer + put CTC back in the name
      
      * remove deprecated class
      
      * remove unused docstring
      
      * delete SpeechT5FeatureExtractor, use Wav2Vec2FeatureExtractor instead
      
      * remove classes we don't need right now
      
      * initial stab at speech encoder prenet
      
      * add more speech encoder prenet stuff
      
      * improve SpeechEncoderPrenet
      
      * add encoder (not finished yet)
      
      * add relative position bias to self-attention
      
      * add encoder CTC layers
      
      * fix formatting
      
      * add decoder from BART, doesn't work yet
      
      * make it work with generate loop
      
      * wrap the encoder into a speech encoder class
      
      * wrap the decoder in a text decoder class
      
      * changed my mind
      
      * changed my mind again ;-)
      
      * load decoder weights, make it work
      
      * add weights for text decoder postnet
      
      * add SpeechT5ForCTC model that uses only the encoder
      
      * clean up EncoderLayer and DecoderLayer
      
      * implement _init_weights in SpeechT5PreTrainedModel
      
      * cleanup config + Encoder and Decoder
      
      * add head + cross attention masks
      
      * improve doc comments
      
      * fixup
      
      * more cleanup
      
      * more fixup
      
      * TextDecoderPrenet works now, thanks Kendall
      
      * add CTC loss
      
      * add placeholders for other pre/postnets
      
      * add type annotation
      
      * fix freeze_feature_encoder
      
      * set padding tokens to 0 in decoder attention mask
      
      * encoder attention mask downsampling
      
      * remove features_pen calculation
      
      * disable the padding tokens thing again
      
      * fixup
      
      * more fixup
      
      * code review fixes
      
      * rename encoder/decoder wrapper classes
      
      * allow checkpoints to be loaded into SpeechT5Model
      
      * put encoder into wrapper for CTC model
      
      * clean up conversion script
      
      * add encoder for TTS model
      
      * add speech decoder prenet
      
      * add speech decoder post-net
      
      * attempt to reconstruct the generation loop
      
      * add speech generation loop
      
      * clean up generate_speech
      
      * small tweaks
      
      * fix forward pass
      
      * enable always dropout on speech decoder prenet
      
      * sort declaration
      
      * rename models
      
      * fixup
      
      * fix copies
      
      * more fixup
      
      * make consistency checker happy
      
      * add Seq2SeqSpectrogramOutput class
      
      * doc comments
      
      * quick note about loss and labels
      
      * add HiFi-GAN implementation (from Speech2Speech PR)
      
      * rename file
      
      * add vocoder to TTS model
      
      * improve vocoder
      
      * working on tokenizer
      
      * more better tokenizer
      
      * add CTC tokenizer
      
      * fix decode and batch_code in CTC tokenizer
      
      * fix processor
      
      * two processors and feature extractors
      
      * use SpeechT5WaveformFeatureExtractor instead of Wav2Vec2
      
      * cleanup
      
      * more cleanup
      
      * even more fixup
      
      * notebooks
      
      * fix log-mel spectrograms
      
      * support reduction factor
      
      * fixup
      
      * shift spectrograms to right to create decoder inputs
      
      * return correct labels
      
      * add labels for stop token prediction
      
      * fix doc comments
      
      * fixup
      
      * remove SpeechT5ForPreTraining
      
      * more fixup
      
      * update copyright headers
      
      * add usage examples
      
      * add SpeechT5ProcessorForCTC
      
      * fixup
      
      * push unofficial checkpoints to hub
      
      * initial version of tokenizer unit tests
      
      * add slow test
      
      * fix failing tests
      
      * tests for CTC tokenizer
      
      * finish CTC tokenizer tests
      
      * processor tests
      
      * initial test for feature extractors
      
      * tests for spectrogram feature extractor
      
      * fixup
      
      * more fixup
      
      * add decorators
      
      * require speech for tests
      
      * modeling tests
      
      * more tests for ASR model
      
      * fix imports
      
      * add fake tests for the other models
      
      * fixup
      
      * remove jupyter notebooks
      
      * add missing SpeechT5Model tests
      
      * add missing tests for SpeechT5ForCTC
      
      * add missing tests for SpeechT5ForTextToSpeech
      
      * sort tests by name
      
      * fix Hi-Fi GAN tests
      
      * fixup
      
      * add speech-to-speech model
      
      * refactor duplicate speech generation code
      
      * add processor for SpeechToSpeech model
      
      * add usage example
      
      * add tests for speech-to-speech model
      
      * fixup
      
      * enable gradient checkpointing for SpeechT5FeatureEncoder
      
      * code review
      
      * push_to_hub now takes repo_id
      
      * improve doc comments for HiFi-GAN config
      
      * add missing test
      
      * add integration tests
      
      * make number of layers in speech decoder prenet configurable
      
      * rename variable
      
      * rename variables
      
      * add auto classes for TTS and S2S
      
      * REMOVE CTC!!!
      
      * S2S processor does not support save/load_pretrained
      
      * fixup
      
      * these models are now in an auto mapping
      
      * fix doc links
      
      * rename HiFiGAN to HifiGan, remove separate config file
      
      * REMOVE auto classes
      
      * there can be only one
      
      * fixup
      
      * replace assert
      
      * reformat
      
      * feature extractor can process input and target at same time
      
      * update checkpoint names
      
      * fix commit hash
      e4bacf66
  28. 31 Jan, 2023 1 commit
    • NielsRogge's avatar
      Add DETA (#20983) · 5451f889
      NielsRogge authored
      * First draft
      
      * Add initial draft of conversion script
      
      * Convert all weights
      
      * Fix config
      
      * Add image processor
      
      * Fix DetaImageProcessor
      
      * Run make fix copies
      
      * Remove timm dependency
      
      * Fix dummy objects
      
      * Improve loss function
      
      * Remove conv_encoder attribute
      
      * Update conversion scripts
      
      * Improve postprocessing + docs
      
      * Fix copied from statements
      
      * Add tests
      
      * Improve postprocessing
      
      * Improve postprocessing
      
      * Update READMEs
      
      * More improvements
      
      * Fix rebase
      
      * Add is_torchvision_available
      
      * Add torchvision dependency
      
      * Fix typo and README
      
      * Fix bug
      
      * Add copied from
      
      * Fix style
      
      * Apply suggestions
      
      * Fix thanks to @ydshieh
      
      * Fix another dependency check
      
      * Simplify image processor
      
      * Add scipy
      
      * Improve code
      
      * Add threshold argument
      
      * Fix bug
      
      * Set default threshold
      
      * Improve integration test
      
      * Add another integration test
      
      * Update setup.py
      
      * Address review
      
      * Improve deformable attention function
      
      * Improve copied from
      
      * Use relative imports
      
      * Address review
      
      * Replace assertions
      
      * Address review
      
      * Update dummies
      
      * Remove dummies
      
      * Address comments, update READMEs
      
      * Remove custom kernel code
      
      * Add image processor tests
      
      * Add requires_backends
      
      * Add minor comment
      
      * Update scripts
      
      * Update organization name
      
      * Fix defaults, add doc tests
      
      * Add id2label for object 365
      
      * Fix tests
      
      * Update task guide
      5451f889
  29. 25 Jan, 2023 1 commit
    • Anahita Bhiwandiwalla's avatar
      Add BridgeTower model (#20775) · 3a6e4a22
      Anahita Bhiwandiwalla authored
      
      
      * Commit with BTModel and latest HF code
      
      * Placeholder classes for BTForMLM and BTForITR
      
      * Importing Bert classes from transformers
      
      * Removed objectives.py and dist_utils.py
      
      * Removed swin_transformer.py
      
      * Add image normalization, BridgeTowerForImageAndTextRetrieval
      
      * Add center_crop
      
      * Removing bert tokenizer and LCI references
      
      * Tested config loading from HF transformers hub
      
      * Removed state_dict updates and added path to hub
      
      * Enable center crop
      
      * Getting image_size from config, renaming num_heads and num_layers
      
      * Handling max_length in BridgeTowerProcessor
      
      * Add BridgeTowerForMaskedLM
      
      * Add doc string for BridgeTowerConfig
      
      * Add doc strings for BT config, processor, image processor
      
      * Adding docs, removed swin
      
      * Removed convert_bridgetower_original_to_pytorch.py
      
      * Added doc files for bridgetower, removed is_vision
      
      * Add support attention_mask=None and BridgeTowerModelOutput
      
      * Fix formatting
      
      * Fixes with 'make style', 'make quality', 'make fixup'
      
      * Remove downstream tasks from BridgeTowerModel
      
      * Formatting fixes, add return_dict to BT models
      
      * Clean up after doc_test
      
      * Update BTModelOutput return type, fix todo in doc
      
      * Remove loss_names from init
      
      * implement tests and update tuples returned by models
      
      * Add image reference to bridgetower.mdx
      
      * after make fix-copies, make fixup, make style, make quality, make repo-consistency
      
      * Rename class names with BridgeTower prefix
      
      * Fix for image_size in BTImageProcessor
      
      * implement feature extraction bridgetower tests
      
      * Update image_mean and image_std to be list
      
      * remove unused import
      
      * Removed old comments
      
      * Rework CLIP
      
      * update config in tests followed config update
      
      * Formatting fixes
      
      * Add copied from for BridgeTowerPredictionHeadTransform
      
      * Update bridgetower.mdx
      
      * Update test_feature_extraction_bridgetower.py
      
      * Update bridgetower.mdx
      
      * BridgeTowerForMaskedLM is conditioned on image too
      
      * Add BridgeTowerForMaskedLM
      
      * Fixes
      
      * Call post_init to init weights
      
      * Move freeze layers into method
      
      * Remove BTFeatureExtractor, add BT under multimodal models
      
      * Remove BTFeatureExtractor, add BT under multimodal models
      
      * Code review feedback - cleanup
      
      * Rename variables
      
      * Formatting and style to PR review feedback
      
      * Move center crop after resize
      
      * Use named parameters
      
      * Style fix for modeling_bridgetower.py
      
      * Update docs/source/en/model_doc/bridgetower.mdx
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update docs/source/en/model_doc/bridgetower.mdx
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update docs/source/en/model_doc/bridgetower.mdx
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update src/transformers/models/bridgetower/modeling_bridgetower.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update src/transformers/models/bridgetower/modeling_bridgetower.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update docs/source/en/model_doc/bridgetower.mdx
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      
      * Update src/transformers/models/bridgetower/modeling_bridgetower.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Rename config params, copy BERT classes, clean comments
      
      * Cleanup irtr
      
      * Replace Roberta imports, add BTTextConfig and Model
      
      * Update docs, add visionconfig, consistent arg names
      
      * make fixup
      
      * Comments for forward in BTModel and make fixup
      
      * correct tests
      
      * Remove inconsistent roberta copied from
      
      * Add BridgeTowerTextModel to dummy_pt_objects.py
      
      * Add BridgeTowerTextModel to IGNORE_NON_TESTED
      
      * Update docs for BT Text and Vision Configs
      
      * Treat BridgeTowerTextModel as a private model
      
      * BridgeTowerTextModel as private
      
      * Run make fix-copies
      
      * Adding BTTextModel to PRIVATE_MODELS
      
      * Fix for issue with BT Text and Image configs
      
      * make style changes
      
      * Update README_ja.md
      
      Add から to BridgeTower's description
      
      * Clean up config, .mdx and arg names
      
      * Fix init_weights. Remove nn.Sequential
      
      * Formatting and style fixes
      
      * Re-add tie_word_embeddings in config
      
      * update test implementation
      
      * update style
      
      * remove commented out
      
      * fix style
      
      * Update README with abs for BridgeTower
      
      * fix style
      
      * fix mdx file
      
      * Update bridgetower.mdx
      
      * Update img src in bridgetower.mdx
      
      * Update README.md
      
      * Update README.md
      
      * resolve style failed
      
      * Update _toctree.yml
      
      * Update README_ja.md
      
      * Removed mlp_ratio, rename feats, rename BTCLIPModel
      
      * Replace BTCLIP with BTVisionModel,pass in vision_config to BTVisionModel
      
      * Add test_initialization support
      
      * Add support for output_hidden_states
      
      * Update support for output_hidden_states
      
      * Add support for output_attentions
      
      * Add docstring for output_hidden_states
      
      * update tests
      
      * add bridgetowervisionmodel as private model
      
      * rerun the PR test
      
      * Remove model_type, pass configs to classes, renames
      
      * Change self.device to use weight device
      
      * Remove image_size
      
      * Style check fixes
      
      * Add hidden_size and num_hidden_layers to BridgeTowerTransformer
      
      * Update device setting
      
      * cosmetic update
      
      * trigger test again
      
      * trigger tests again
      
      * Update test_modeling_bridgetower.py
      
      trigger tests again
      
      * Update test_modeling_bridgetower.py
      
      * minor update
      
      * re-trigger tests
      
      * Update docs/source/en/model_doc/bridgetower.mdx
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Remove pad, update max_text_len, doc cleanup, pass eps to LayerNorm
      
      * Added copied to, some more review feedback
      
      * make fixup
      
      * Use BridgeTowerVisionEmbeddings
      
      * Code cleanup
      
      * Fixes for BridgeTowerVisionEmbeddings
      
      * style checks
      
      * re-tests
      
      * fix embedding
      
      * address comment on init file
      
      * retrigger tests
      
      * update import prepare_image_inputs
      
      * update test_image_processing_bridgetower.py to reflect test_image_processing_common.py
      
      * retrigger tests
      Co-authored-by: default avatarShaoyen Tseng <shao-yen.tseng@intel.com>
      Co-authored-by: default avatarTiep Le <tiep.le@intel.com>
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      Co-authored-by: default avatarTiep Le <97980157+tileintel@users.noreply.github.com>
      3a6e4a22
  30. 23 Jan, 2023 1 commit
  31. 20 Jan, 2023 1 commit
  32. 19 Jan, 2023 2 commits
    • Clémentine Fourrier's avatar
      Graphormer model for Graph Classification (#20968) · 87208a05
      Clémentine Fourrier authored
      
      
      * [FT] First commit for graphormer architecture.
      
      The model has no tokenizer, as it uses a collator and preprocessing function for its input management.
      Architecture to be tested against original one.
      The arch might need to be changed to fit the checkpoint, but a revert to the original arch will make the code less nice to read.
      TODO: doc
      
      * [FIX] removed test model
      
      * [FIX] import error
      
      * [FIX] black and flake
      
      * [DOC] added paper refs
      
      * [FIX] [DOC]
      
      * [FIX] black
      
      * [DOC] Updated READMEs
      
      * [FIX] Order of imports + rm Tokenizer calls
      
      * [FIX] Moved assert in class to prevent doc build failure
      
      * [FIX] make fix-copies
      
      * [Doc] update from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * [FIX] Removed Graphormer from Sequence classification model list
      
      * [DOC] Added HF copyright to Cython file
      
      * [DOC] Fixed comments
      
      * [FIX] typos in class doc + removed config classes.
      
      Todo: update doc from paper definitions
      
      * [FIX] Removed dependency to fairseq, and replaced all asserts with Exception management
      
      * [FIX] Homogeneized initialization of weights to pretrained constructor
      
      * [FIX] [CP] Updated multi_hop parameter to get same results as in original implementation
      
      * [DOC] Relevant parameter description in the configuration file
      
      * [DOC] Updated doc and comments in main graphormer file
      
      * [FIX] make style and quality checks
      
      * [DOC] Fix doc format
      
      * [FIX] [WIP] Updated part of the tests, though still a wip
      
      * [FIX] [WIP]
      
      * [FIX] repo consistency
      
      * [FIX] Changed input names for more understandability
      
      * [FIX] [BUG] updated num_classes params for propagation in the model
      
      * simplified collator
      
      * [FIX] Updated tests to follow new naming pattern
      
      * [TESTS] Updated test suite along with model
      
      * |FIX] rm tokenizer import
      
      * [DOC] add link to graphormerdoc
      
      * Changed section in doc from text model to graph model
      
      * Apply suggestions from code review
      
      Spacing, inits
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * [DOC] Explain algos_graphormer functions
      
      * Cython soft import protection
      
      * Rm call to Callable in configuration graphormer
      
      * [FIX] replaced asserts with Exceptions
      
      * Add org to graphormer checkpoints
      
      * Prefixed classes with Graphormer
      
      * Management of init functions
      
      * format
      
      * fixes
      
      * fix length file
      
      * update indent
      
      * relaunching ci
      
      * Errors for missing cython imports
      
      * fix style
      
      * fix style doc
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      87208a05
    • Jitesh Jain's avatar
      Add OneFormer Model (#20577) · 5b949623
      Jitesh Jain authored
      * Add Oneformer Model
      
      * Add OneFormer Tests
      
      * Add UNIVERSAL_SEGMENTATION_MAPPING
      
      * Fix config
      
      * 🐛 Fix error encountered while writing tests
      
      * 🔨 Fix instance segmentation post processing
      
      * Format Files and Add Documentation
      
      * Add Documentation mdx file
      
      * Run make fixup
      
      * Run make fix-copies
      
      * Remove unnecessary code
      
      * Format modeling_oneformer.py
      
      * Add OneFormer to ImageSegmentationPipeline
      
      * Format files
      
      * Add Demo link to Readme
      
      * Fix fomatting errors
      
      * Fix test failures
      
      * Update Table in index.mdx
      
      * Fix version
      
      * Fix style
      
      * Remove OneFormer from TF
      
      * Fix Imports
      
      * Fix dummy objects
      
      * Fix tests
      
      * Add newline
      
      * Remove OneFormerFeatureExtractor
      
      * Remove CUDA Kernels
      
      * Use AutoBackbone for Swin
      
      * Fix description
      
      * Use Image Processor
      
      * Fix copies
      
      * Fix formatting
      
      * Fix import order
      
      * Fix flake8 errors
      
      * Fix doc errors
      
      * Add Hindi Readme entry
      
      * Update supported backbones
      
      * Update supported backbones
      
      * Undo Changes
      
      * Fix type of config
      
      * Fix isort
      
      * Fix auto.mdx
      
      * Fix swin config
      
      * Replace DinatBackbone with AutoBackbone
      
      * Use SwinBackbone
      
      * Use SwinBackbone
      
      * Fix conversion script
      
      * Fix arguments
      
      * Add argument description
      
      * Fix style
      
      * Add OneFormerProcessor
      
      * Fix OneFormerProcessor Tests
      
      * Fix mapping
      
      * Fix imports
      
      * Fix inits
      
      * Fix style
      
      * Fix comment
      
      * Fix docstring
      
      * Move OneFormer to MultiModal
      
      * Fix Copies
      
      * Remove size divisor
      
      * Fix check_repo.py
      
      * Fix copies
      
      * Add Processor for Testing Pipeline
      
      * Fix padding for tokens
      
      * Fix variables
      
      * Fix formatting with correct black version
      
      * Add Image Processor Test
      
      * Apply suggestions
      
      * Revert common modeling
      
      * Add check for task
      
      * Fix conversion script
      
      * Fix initialization order
      
      * Fix tests
      
      * Undo Pipeline Changes
      
      * Fix layers in MLP
      
      * Fix copies
      
      * Update image paths
      
      * Fix copies
      
      * Apply suggestions
      5b949623