1. 29 Sep, 2022 1 commit
    • Aritra Roy Gosthipaty's avatar
      [TensorFlow] Adding GroupViT (#18020) · 0dc7b3a7
      Aritra Roy Gosthipaty authored
      
      
      * chore: initial commit
      
      * chore: adding util methods
      
      yet to work on the nn.functional.interpolate port with align_corener=True
      
      * chore: refactor the utils
      
      * used tf.compat.v1.image.resize to align the F.interpolate function
      * added type hints to the method signatures
      * added references to the gists where one 2 one alignment of torch and tf has been shown
      
      * chore: adding the layers
      
      * chore: porting all the layers from torch to tf
      
      This is the initial draft, nothing is tested yet.
      
      * chore: aligning the layers with reference to tf clip
      
      * chore: aligning the modules
      
      * added demaraction comments
      * added copied and adapted from comments
      
      * chore: aligning with CLIP
      
      * chore: wrangling the layers to keep it tf compatible
      
      * chore: aligning the names of the layers for porting
      
      * chore: style changes
      
      * chore: adding docs and inits
      
      * chore: adding tfp dependencis
      
      the code is taken from TAPAS
      
      * chore: initial commit for testing
      
      * chore: aligning the vision embeddings with the vit implementatino
      
      * chore: changing model prefix
      
      * chore: fixing the name of the model and the layer normalization test case
      
      * chore: every test passes but the slow ones
      
      * chore: fix style and integration test
      
      * chore: moving comments below decorators
      
      * chore: make fixup and fix-copies changes
      
      * chore: adding the Vision and Text Model to check_repo
      
      * chore: modifying the prefix name to align it with the torch implementation
      
      * chore: fix typo in configuration
      
      * choer: changing the name of the model variable
      
      * chore: adding segmentation flag
      
      * chore: gante's review
      
      * chore: style refactor
      
      * chore: amy review
      
      * chore: adding shape_list to parts that have been copied from other snippets
      
      * chore: init batchnorm with torch defaults
      
      * chore: adding shape_list to pass the tests
      
      * test fix: adding seed as 0
      
      * set seed
      
      * chore: changing the straight through trick to fix -ve dimensinos
      
      * chore: adding a dimension to the loss
      
      * chore: adding reviewers and contributors names to the docs
      
      * chore: added changes after review
      
      * chore: code quality fixup
      
      * chore: fixing the segmentation snippet
      
      * chore: adding  to the layer calls
      
      * chore: changing int32 to int64 for inputs of serving
      
      * chore: review changes
      
      * chore: style changes
      
      * chore: remove from_pt=True
      
      * fix: repo consistency
      Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
      0dc7b3a7
  2. 23 Sep, 2022 1 commit
  3. 22 Sep, 2022 2 commits
  4. 14 Sep, 2022 1 commit
    • NielsRogge's avatar
      Add Deformable DETR (#17281) · 59407bbe
      NielsRogge authored
      
      
      * First draft
      
      * More improvements
      
      * Improve model, add custom CUDA code
      
      * Import torch before
      
      * Add script that imports custom layer
      
      * Add everything in new ops directory
      
      * Import custom layer in modeling file
      
      * Fix ARCHIVE_MAP typo
      
      * Creating the custom kernel on the fly.
      
      * Import custom layer in modeling file
      
      * More improvements
      
      * Fix CUDA loading
      
      * More improvements
      
      * Improve conversion script
      
      * Improve conversion script
      
      * Make it work until encoder_outputs
      
      * Make forward pass work
      
      * More improvements
      
      * Make logits match original implementation
      
      * Make implementation also support single_scale model
      
      * Add support for single_scale and dilation checkpoint
      
      * Add support for with_box_refine model
      
      * Support also two stage model
      
      * Improve tests
      
      * Fix more tests
      
      * Make more tests pass
      
      * Upload all models to the hub
      
      * Clean up some code
      
      * Improve decoder outputs
      
      * Rename intermediate hidden states and reference points
      
      * Improve model outputs
      
      * Move tests to dedicated folder
      
      * Improve model outputs
      
      * Fix retain_grad test
      
      * Improve docs
      
      * Clean up and make test_initialization pass
      
      * Improve variable names
      
      * Add copied from statements
      
      * Improve docs
      
      * Fix style
      
      * Improve docs
      
      * Improve docs, move tests to model folder
      
      * Fix rebase
      
      * Remove DetrForSegmentation from auto mapping
      
      * Apply suggestions from code review
      
      * Improve variable names and docstrings
      
      * Apply some more suggestions from code review
      
      * Apply suggestion from code review
      
      * better docs and variables names
      
      * hint to num_queries and two_stage confusion
      
      * remove asserts and code refactor
      
      * add exception if two_stage is True and with_box_refine is False
      
      * use f-strings
      
      * Improve docs and variable names
      
      * Fix code quality
      
      * Fix rebase
      
      * Add require_torch_gpu decorator
      
      * Add pip install ninja to CI jobs
      
      * Apply suggestion of @sgugger
      
      * Remove DeformableDetrForObjectDetection from auto mapping
      
      * Remove DeformableDetrModel from auto mapping
      
      * Add model to toctree
      
      * Add model back to mappings, skip model in pipeline tests
      
      * Apply @sgugger's suggestion
      
      * Fix imports in the init
      
      * Fix copies
      
      * Add CPU implementation
      
      * Comment out GPU function
      
      * Undo previous change
      
      * Apply more suggestions
      
      * Remove require_torch_gpu annotator
      
      * Fix quality
      
      * Add logger.info
      
      * Fix logger
      
      * Fix variable names
      
      * Fix initializaztion
      
      * Add missing initialization
      
      * Update checkpoint name
      
      * Add model to doc tests
      
      * Add CPU/GPU equivalence test
      
      * Add Deformable DETR to pipeline tests
      
      * Skip model for object detection pipeline
      Co-authored-by: default avatarNicolas Patry <patry.nicolas@protonmail.com>
      Co-authored-by: default avatarNouamane Tazi <nouamane98@gmail.com>
      Co-authored-by: default avatarSylvain Gugger <Sylvain.gugger@gmail.com>
      59407bbe
  5. 01 Sep, 2022 1 commit
  6. 31 Aug, 2022 1 commit
    • Ankur Goyal's avatar
      Add LayoutLMForQuestionAnswering model (#18407) · 5c4c8690
      Ankur Goyal authored
      
      
      * Add LayoutLMForQuestionAnswering model
      
      * Fix output
      
      * Remove TF TODOs
      
      * Add test cases
      
      * Add docs
      
      * TF implementation
      
      * Fix PT/TF equivalence
      
      * Fix loss
      
      * make fixup
      
      * Fix up documentation code examples
      
      * Fix up documentation examples + test them
      
      * Remove LayoutLMForQuestionAnswering from the auto mapping
      
      * Docstrings
      
      * Add better docstrings
      
      * Undo whitespace changes
      
      * Update tokenizers in comments
      
      * Fixup code and remove `from_pt=True`
      
      * Fix tests
      
      * Revert some unexpected docstring changes
      
      * Fix tests by overriding _prepare_for_class
      Co-authored-by: default avatarAnkur Goyal <ankur@impira.com>
      5c4c8690
  7. 30 Aug, 2022 2 commits
  8. 12 Aug, 2022 1 commit
    • NielsRogge's avatar
      Add Donut (#18488) · 2ab790e8
      NielsRogge authored
      
      
      * First draft
      
      * Improve script
      
      * Update script
      
      * Make conversion work
      
      * Add final_layer_norm attribute to Swin's config
      
      * Add DonutProcessor
      
      * Convert more models
      
      * Improve feature extractor and convert base models
      
      * Fix bug
      
      * Improve integration tests
      
      * Improve integration tests and add model to README
      
      * Add doc test
      
      * Add feature extractor to docs
      
      * Fix integration tests
      
      * Remove register_buffer
      
      * Fix toctree and add missing attribute
      
      * Add DonutSwin
      
      * Make conversion script work
      
      * Improve conversion script
      
      * Address comment
      
      * Fix bug
      
      * Fix another bug
      
      * Remove deprecated method from docs
      
      * Make Swin and Swinv2 untouched
      
      * Fix code examples
      
      * Fix processor
      
      * Update model_type to donut-swin
      
      * Add feature extractor tests, add token2json method, improve feature extractor
      
      * Fix failing tests, remove integration test
      
      * Add do_thumbnail for consistency
      
      * Improve code examples
      
      * Add code example for document parsing
      
      * Add DonutSwin to MODEL_NAMES_MAPPING
      
      * Add model to appropriate place in toctree
      
      * Update namespace to appropriate organization
      Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
      2ab790e8
  9. 08 Aug, 2022 1 commit
  10. 28 Jul, 2022 1 commit
  11. 26 Jul, 2022 1 commit
    • Alara Dirik's avatar
      Owlvit docs test (#18257) · 002915aa
      Alara Dirik authored
      * fix docs and add owlvit docs test
      
      * fix minor bug in post_process, add to processor
      
      * improve owlvit code examples
      
      * fix hardcoded image size
      002915aa
  12. 21 Jul, 2022 1 commit
    • Sayak Paul's avatar
      [SegFormer] TensorFlow port (#17910) · 561b9a8c
      Sayak Paul authored
      
      
      * add: segformer utils and img. classification.
      
      * add: segmentation layer.
      
      * feat: working implementation of segformer.
      
      * chore: remove unused variable.
      
      * add test, remaining modifications.
      
      * remove: unnecessary files.
      
      * add: rest of the files.
      Co-authored-by: default avatarmatt <rocketknight1@gmail.com>
      
      * chore: remove ModuleList comment.
      
      * chore: apply make style.
      
      * chore: apply make fixup-copies.
      
      * add  to check_repo.py
      
      * add decode head to IGNORE_NON_TESTED
      
      * chore: run make style.
      
      * chore: PR comments.
      
      * chore: minor changes to model doc.
      
      * tests: reduction across samples.
      
      * add a note on the space.
      
      * sort importats.
      
      * fix: reduction in loss computation.
      
      * chore: align loss function with that of NER.
      
      * chore: correct utils/documentation_tests.txt
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * chore: simplify the interpolation of logits in loss computation.
      
      * chore: return transposed logits when return_dict=False.
      
      * chore: add link to the tf fine-tuning repo.
      
      * address pr comments.
      
      * address niels's comments.
      
      * remove from_pt=True since tf weights are in.
      
      * remove comment from pt model.
      
      * address niels's comments.
      Co-authored-by: default avatarmatt <rocketknight1@gmail.com>
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      561b9a8c
  13. 13 Jul, 2022 1 commit
  14. 04 Jul, 2022 1 commit
  15. 29 Jun, 2022 2 commits
  16. 24 Jun, 2022 1 commit
  17. 23 Jun, 2022 1 commit
    • Quentin's avatar
      add doctests for DETR (#17786) · ab223fc1
      Quentin authored
      * add: check labels for detr object detection doctests
      
      * add: check shapes
      
      * add: add detr to documentation_tests.py
      
      * fix: make fixup output
      
      * fix: add a comment
      ab223fc1
  18. 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
  19. 31 May, 2022 1 commit
    • Arthur's avatar
      Opt in flax and tf (#17388) · 7822a9b7
      Arthur authored
      
      
      * initial commit
      
      * add init file
      
      * update globakl init
      
      * update index and dummy objects
      
      * style
      
      * update modelling auto
      
      * fix initi typo in src/transformers
      
      * fix typo in modeling tf auto, opt was in wrong mapping name
      
      * fixed a slow test : saved_model
      
      * style
      
      * fix positionnal embedding if no position id is provided
      
      * update tf test
      
      * update test flax requirements
      
      * fixed serialization
      
      * update
      
      * update tf name to allow smooth convertion
      
      * update flax tests
      
      * style
      
      * fix test typo
      
      * fix tf typo test
      
      * add xla for generate support in causal LM
      
      * fixed bug
      
      * cleaned tf tests
      
      * style
      
      * removed from PT for slow tests
      
      * fix typp
      
      * opt test as slow
      
      * trying to fix GPT2 undefined
      
      * correct documentation and add to test doc
      
      * update tf doc
      
      * fix doc
      
      * fake commit
      
      * Apply suggestions from code review
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * update test based on review
      
      * merged main layer for functionning test
      
      * fixup + quality
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * update long comment
      
      * make fix copies
      Co-authored-by: default avatarArthur <arthur@huggingface.co>
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      7822a9b7
  20. 24 May, 2022 1 commit
    • 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
  21. 23 May, 2022 1 commit
    • ghlai9665's avatar
      Correct & Improve Doctests for LayoutLMv2 (#17168) · 7b8cb269
      ghlai9665 authored
      
      
      * add inference example to LayoutLMv2ForQuestionAnswering, passing doctest
      
      * add loss example to LayoutLMv2ForQuestionAnswering, passing doctest
      
      * Add correct doctest for LayoutLMv2ForTokenClassification, passing doctest
      
      * add correct doctest for LayoutLMv2ForSequenceClassification, passing test
      
      * add correct doctest for LayoutLMv2Model, passing test
      
      * make fixup
      
      * fix to address review comments
      
      * make style
      
      * fix doctest line break issue, add to documentaiton_tests.txt, address review comments
      
      * move comment about layoutlmv2 dependencies to the doc page
      
      * format doc page as suggested
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * delete extraneous backtick
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      7b8cb269
  22. 18 May, 2022 1 commit
  23. 17 May, 2022 1 commit
  24. 16 May, 2022 1 commit
    • Patrick von Platen's avatar
      Add Wav2Vec2Conformer (#16812) · 5a995735
      Patrick von Platen authored
      
      
      * save intermediate
      
      * add wav2vec2 conformer
      
      * add more code
      
      * more
      
      * first test passes
      
      * make all checkpoints work
      
      * update
      
      * up
      
      * more clean ups
      
      * save clean-up
      
      * save clean-up
      
      * save more
      
      * remove bogus
      
      * finalize design conformer
      
      * remove vision
      
      * finish all tests
      
      * more changes
      
      * finish code
      
      * add doc tests
      
      * add slow tests
      
      * fix autoconfig test
      
      * up
      
      * correct docstring
      
      * up
      
      * update
      
      * fix
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * Update docs/source/en/model_doc/wav2vec2-conformer.mdx
      
      * upload
      
      * save copied from
      
      * correct configs
      
      * fix model outputs
      
      * add to docs
      
      * fix imports
      
      * finish
      
      * finish code
      
      * correct copied from
      
      * correct again
      
      * correct make fix
      
      * improve make fix copies
      
      * save
      
      * correct fix copy from
      
      * correct init structure
      
      * correct
      
      * fix import
      
      * apply suggestions
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      5a995735
  25. 13 May, 2022 1 commit
  26. 04 May, 2022 1 commit
  27. 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
  28. 26 Apr, 2022 1 commit
  29. 25 Apr, 2022 1 commit
  30. 22 Apr, 2022 1 commit
  31. 21 Apr, 2022 1 commit
  32. 20 Apr, 2022 1 commit
  33. 18 Apr, 2022 1 commit
  34. 13 Apr, 2022 4 commits