Matthijs Hollemans
fbc7598bab
add MobileViT model ( #17354 )
...
* add MobileViT
* fixup
* Update README.md
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* remove empty line
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* use clearer variable names
* rename to MobileViTTransformerLayer
* no longer inherit from nn.Sequential
* fixup
* fixup
* not sure why this got added twice
* rename organization for checkpoints
* fix it up
* Update src/transformers/models/mobilevit/__init__.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* Update src/transformers/models/mobilevit/configuration_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* Update src/transformers/models/mobilevit/configuration_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* Update src/transformers/models/mobilevit/configuration_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* Update tests/models/mobilevit/test_modeling_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* Update src/transformers/models/mobilevit/modeling_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* Update src/transformers/models/mobilevit/modeling_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* Update src/transformers/models/mobilevit/modeling_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* Update src/transformers/models/mobilevit/modeling_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* code style improvements
* fixup
* Update docs/source/en/model_doc/mobilevit.mdx
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* Update docs/source/en/model_doc/mobilevit.mdx
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* Update src/transformers/models/mobilevit/configuration_mobilevit.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* Update src/transformers/models/mobilevit/configuration_mobilevit.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* download labels from hub
* rename layers
* rename more layers
* don't compute loss in separate function
* remove some nn.Sequential
* replace nn.Sequential with new MobileViTTransformer class
* replace nn.Sequential with MobileViTMobileNetLayer
* fix pruning since model structure changed
* fixup
* fix doc comment
* remove custom resize from feature extractor
* fix ONNX import
* add to doc tests
* use center_crop from image_utils
* move RGB->BGR flipping into image_utils
* fix broken tests
* wrong type hint
* small tweaks
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
2022-06-29 16:07:51 -04:00
Matt
5feac3d080
Fix prepare_tf_dataset when drop_remainder is not supplied ( #17950 )
2022-06-29 19:23:39 +01:00
Bram Vanroy
bc019b0e5f
ExplicitEnum subclass str (JSON dump compatible) ( #17933 )
...
* ExplicitEnum subclass str (JSON dump compatible)
* allow union if one of the types is str
2022-06-29 13:49:31 -04:00
Yih-Dar
b089cca347
PyTorch 1.12.0 for scheduled CI ( #17949 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-29 19:32:19 +02:00
Younes Belkada
d444edb3f6
OPT - Fix Softmax NaN in half precision mode ( #17437 )
2022-06-29 19:15:32 +02:00
Yih-Dar
9fe2403bc5
Use explicit torch version in deepspeed CI ( #17942 )
...
* use explicit torch version
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-29 18:20:34 +02:00
Stas Bekman
4c722e9e22
fix regexes with escape sequence ( #17943 )
2022-06-29 08:55:22 -07:00
Zachary Mueller
7c4c6f6084
Fix all is_torch_tpu_available issues ( #17936 )
...
* Fix all is_torch_tpu_available
2022-06-29 11:03:33 -04:00
Mishig Davaadorj
77b76672e2
Fix img seg tests (load checkpoints from hf-internal-testing) ( #17939 )
...
* Revert "Skip failing test until they are fixed."
This reverts commit 8f400775fc .
* Use `tiny-detr` checkpts from `hf-internal-testing`
2022-06-29 10:19:37 -04:00
StevenTang1998
3cff4cc587
Add MVP model ( #17787 )
...
* Add MVP model
* Update README
* Remove useless module
* Update docs
* Fix bugs in tokenizer
* Remove useless test
* Remove useless module
* Update vocab
* Remove specifying
* Remove specifying
* Add #Copied ... statement
* Update paper link
* Remove useless TFMvp
* Add #Copied ... statement
* Fix style in test mvp model
* Fix some typos
* Fix properties of unset special tokens in non verbose mode
* Update paper link
* Update MVP doc
* Update MVP doc
* Fix README
* Fix typos in docs
* Update docs
2022-06-29 09:30:55 -04:00
Sylvain Gugger
8f400775fc
Skip failing test until they are fixed.
2022-06-29 09:11:29 -04:00
Sylvain Gugger
47b9165109
Remove imports and use forward references in ONNX feature ( #17926 )
2022-06-29 09:02:53 -04:00
Yih-Dar
5cdfff5df3
Fix job links in Slack report ( #17892 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-29 14:53:13 +02:00
Aritra Roy Gosthipaty
a7eba83161
TF implementation of RegNets ( #17554 )
...
* chore: initial commit
Copied the torch implementation of regnets and porting the code to tf step by step. Also introduced an output layer which was needed for regnets.
* chore: porting the rest of the modules to tensorflow
did not change the documentation yet, yet to try the playground on the model
* Fix initilizations (#1 )
* fix: code structure in few cases.
* fix: code structure to align tf models.
* fix: layer naming, bn layer still remains.
* chore: change default epsilon and momentum in bn.
* chore: styling nits.
* fix: cross-loading bn params.
* fix: regnet tf model, integration passing.
* add: tests for TF regnet.
* fix: code quality related issues.
* chore: added rest of the files.
* minor additions..
* fix: repo consistency.
* fix: regnet tf tests.
* chore: reorganize dummy_tf_objects for regnet.
* chore: remove checkpoint var.
* chore: remov unnecessary files.
* chore: run make style.
* Update docs/source/en/model_doc/regnet.mdx
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* chore: PR feedback I.
* fix: pt test. thanks to @ydshieh.
* New adaptive pooler (#3 )
* feat: new adaptive pooler
Co-authored-by: @Rocketknight1
* chore: remove image_size argument.
Co-authored-by: matt <rocketknight1@gmail.com >
Co-authored-by: matt <rocketknight1@gmail.com >
* Empty-Commit
* chore: remove image_size comment.
* chore: remove playground_tf.py
* chore: minor changes related to spacing.
* chore: make style.
* Update src/transformers/models/regnet/modeling_tf_regnet.py
Co-authored-by: amyeroberts <aeroberts4444@gmail.com >
* Update src/transformers/models/regnet/modeling_tf_regnet.py
Co-authored-by: amyeroberts <aeroberts4444@gmail.com >
* chore: refactored __init__.
* chore: copied from -> taken from./g
* adaptive pool -> global avg pool, channel check.
* chore: move channel check to stem.
* pr comments - minor refactor and add regnets to doc tests.
* Update src/transformers/models/regnet/modeling_tf_regnet.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* minor fix in the xlayer.
* Empty-Commit
* chore: removed from_pt=True.
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
Co-authored-by: matt <rocketknight1@gmail.com >
Co-authored-by: amyeroberts <aeroberts4444@gmail.com >
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
2022-06-29 13:45:14 +01:00
Joao Gante
e6d27ca5c8
TF: XLA beam search + most generation-compatible models are now also XLA-generate-compatible ( #17857 )
...
* working beam search 🎉
* XLA generation compatible with ALL classes
* add xla generation slow test
2022-06-29 12:41:01 +01:00
Leon Derczynski
b8142753f9
Add missing comment quotes ( #17379 )
2022-06-29 06:16:36 -04:00
NielsRogge
e113c5cb64
Remove render tags ( #17897 )
...
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local >
2022-06-29 06:06:42 -04:00
Santiago Castro
90415475bb
Fix the Conda package build ( #16737 )
...
* Fix the Conda package build
* Update build.sh
* Update release-conda.yml
2022-06-29 06:03:16 -04:00
Michal Szutenberg
babd7b1a92
Remove DT_DOUBLE from the T5 graph ( #17891 )
2022-06-29 10:23:49 +01:00
Yih-Dar
6aae59d0b5
Compute min_resolution in prepare_image_inputs ( #17915 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-29 10:30:20 +02:00
Nicolas Patry
776855c752
Fixing a regression with return_all_scores introduced in #17606 ( #17906 )
...
Fixing a regression with `return_all_scores` introduced in #17606
- The legacy test actually tested `return_all_scores=False` (the actual
default) instead of `return_all_scores=True` (the actual weird case).
This commit adds the correct legacy test and fixes it.
Tmp legacy tests.
Actually fix the regression (also contains lists)
Less diffed code.
2022-06-28 17:24:45 -04:00
Sylvain Gugger
5f1e67a566
Pin PyTorch in requirements as well
2022-06-28 15:56:10 -04:00
Sylvain Gugger
5a3d0cbdda
Pin PyTorch while we fix compatibility with 1.12
2022-06-28 15:07:26 -04:00
Jerry Jiarui XU
6c8f4c9a93
Adding GroupViT Models ( #17313 )
...
* add group vit and fixed test (except slow)
* passing slow test
* addressed some comments
* fixed test
* fixed style
* fixed copy
* fixed segmentation output
* fixed test
* fixed relative path
* fixed copy
* add ignore non auto configured
* fixed docstring, add doc
* fixed copies
* Apply suggestions from code review
merge suggestions
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
* resolve comment, renaming model
* delete unused attr
* use fix copies
* resolve comments
* fixed attn
* remove unused vars
* refactor tests
* resolve final comments
* add demo notebook
* fixed inconsitent default
* Apply suggestions from code review
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* Apply suggestions from code review
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
* rename stage->stages
* Create single GroupViTEncoderLayer class
* Update conversion script
* Simplify conversion script
* Remove cross-attention class in favor of GroupViTAttention
* Convert other model as well, add processor to conversion script
* addressing final comment
* fixed args
* Update src/transformers/models/groupvit/modeling_groupvit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com >
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com >
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local >
2022-06-28 20:51:47 +02:00
mrbean
b424f0b4a3
Mrbean/codegen onnx ( #17903 )
2022-06-28 14:57:53 +02:00
regisss
76d13de5ae
Add ONNX support for DETR ( #17904 )
2022-06-28 14:48:43 +02:00
Bill Ray
bfcd5743ee
In group_texts function, drop last block if smaller than block_size ( #17908 )
2022-06-28 08:34:55 -04:00
amyeroberts
f71895a633
Move logic into pixelshuffle layer ( #17899 )
...
* Move all pixelshuffle logic into layer
* Rename layer
* Use correct input to function
2022-06-28 13:04:19 +01:00
Matt
0094565fc5
Fix loss computation in TFBertForPreTraining ( #17898 )
2022-06-28 12:44:56 +01:00
Lysandre Debut
1dfa03f12b
Pin black to 22.3.0 to benefit from a stable --preview flag ( #17918 )
2022-06-28 04:32:18 -04:00
Suraj Patil
9eec4e937e
[M2M100] update conversion script ( #17916 )
2022-06-28 10:15:07 +02:00
Yih-Dar
db2644b9eb
Fix PyTorch/TF Auto tests ( #17895 )
...
* add loading_info
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-28 08:56:24 +02:00
Yih-Dar
f717d47fe0
Fix test_number_of_steps_in_training_with_ipex ( #17889 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-28 08:55:02 +02:00
Yih-Dar
0b0dd97737
Update expected values in constrained beam search tests ( #17887 )
...
* fix
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-28 08:53:53 +02:00
Andrej
e02037b352
Fix bug in gpt2's (from-scratch) special scaled weight initialization ( #17877 )
...
* only special scale init each gpt2 c_proj weight once, on exact match
* fix double quotes
Co-authored-by: leandro <leandro.vonwerra@spoud.io >
2022-06-27 15:01:49 -04:00
JiJi
6dd00f6bd4
Update README_zh-hans.md ( #17861 )
2022-06-27 13:09:20 -04:00
Stefan Schweter
71b2839fd3
bert: add conversion script for BERT Token Dropping TF2 checkpoints ( #17142 )
...
* bert: add conversion script for BERT Token Dropping TF2 checkpoints
* bert: rename conversion script for BERT Token Dropping checkpoints
* bert: fix flake errors in BERT Token Dropping conversion script
* bert: make doc-builder happy!!1!11
* bert: fix pytorch_dump_path of BERT Token Dropping conversion script
2022-06-27 13:08:32 -04:00
Sylvain Gugger
98742829d3
Fix add new model like frameworks ( #17869 )
...
* Add new model like adds only the selected frameworks object in init
* Small fix
2022-06-27 13:07:34 -04:00
Ian Castillo
afb71b6726
Add type annotations for RoFormer models ( #17878 )
2022-06-27 14:50:43 +01:00
Yih-Dar
9a3453846b
fix ( #17890 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-27 14:36:11 +02:00
Younes Belkada
3ec7d4cfe4
fix mask ( #17837 )
2022-06-27 14:08:18 +02:00
Matt
ee0d001de7
Add a TF in-graph tokenizer for BERT ( #17701 )
...
* Add a TF in-graph tokenizer for BERT
* Add from_pretrained
* Add proper truncation, option handling to match other tokenizers
* Add proper imports and guards
* Add test, fix all the bugs exposed by said test
* Fix truncation of paired texts in graph mode, more test updates
* Small fixes, add a (very careful) test for savedmodel
* Add tensorflow-text dependency, make fixup
* Update documentation
* Update documentation
* make fixup
* Slight changes to tests
* Add some docstring examples
* Update tests
* Update tests and add proper lowercasing/normalization
* make fixup
* Add docstring for padding!
* Mark slow tests
* make fixup
* Fall back to BertTokenizerFast if BertTokenizer is unavailable
* Fall back to BertTokenizerFast if BertTokenizer is unavailable
* make fixup
* Properly handle tensorflow-text dummies
2022-06-27 12:06:21 +01:00
Yih-Dar
401fcca6c5
Fix TF GPT2 test_onnx_runtime_optimize ( #17874 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-27 09:27:30 +02:00
Joao Gante
cc5c061e34
CLI: handle multimodal inputs ( #17839 )
2022-06-25 16:17:11 +01:00
Sylvain Gugger
e8eb699ee8
Properly get tests deps in test_fetcher ( #17870 )
...
* Properly get tests deps in test_fetcher
* Remove print
2022-06-24 16:56:46 -04:00
Yih-Dar
b03be78a4b
Fix test_inference_instance_segmentation_head ( #17872 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-24 19:36:45 +02:00
Yih-Dar
494aac65a7
Skip test_multi_gpu_data_parallel_forward for MaskFormer ( #17864 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-24 19:35:00 +02:00
Yih-Dar
0e0f1f4692
Use higher value for hidden_size in Flax BigBird test ( #17822 )
...
* Use higher value for hidden_size in Flax BigBird test
* remove 5e-5
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com >
2022-06-24 19:31:30 +02:00
kumapo
2ef94ee039
Fix: torch.utils.checkpoint import error. ( #17849 )
2022-06-24 13:23:29 -04:00
willtai
ef28a402a9
Add type hints for gptneox models ( #17858 )
...
* feat: Add type hints for GPTNeoxForCausalLM and GPTNeoXModel
* fix: removed imported Dict type
* fix: Removed unused List import
2022-06-24 17:12:36 +01:00