regisss
9cb7cef285
Add ONNX support for LayoutLMv3 ( #17953 )
...
* Add ONNX support for LayoutLMv3
* Update docstrings
* Update empty description in docstring
* Fix imports and type hints
2022-06-30 12:09:52 -04:00
Yih-Dar
fe14046421
skip some ipex tests until it works with torch 1.12 ( #17964 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-06-30 18:05:29 +02:00
Joao Gante
91e1f24ef3
CLI: convert sharded PT models ( #17959 )
...
* sharded conversion; add flag to control max hidden error
* better hidden name matching
* Add test: load TF from PT shards
* fix test (PT data must be local)
2022-06-30 16:51:03 +01:00
Sylvain Gugger
f25457b273
Fix number of examples for iterable dataset in distributed training ( #17951 )
2022-06-30 11:01:40 -04:00
Patrick von Platen
e4d2588573
[Pipelines] Add revision tag to all default pipelines ( #17667 )
...
* trigger test failure
* upload revision poc
* Update src/transformers/pipelines/base.py
Co-authored-by: Julien Chaumond <julien@huggingface.co>
* up
* add test
* correct some stuff
* Update src/transformers/pipelines/__init__.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* correct require flag
Co-authored-by: Julien Chaumond <julien@huggingface.co>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-06-30 16:37:18 +02:00
Jannis Born
4f8361afe7
Unifying training argument type annotations ( #17934 )
...
* doc: Unify training arg type annotations
* wip: extracting enum type from Union
* blackening
2022-06-30 08:53:32 -04:00
Jason Phang
205bc4152c
Fix GPT-NeoX-20B past handling, attention computation ( #17811 )
...
* Fix GPT-NeoX-20B past handling, swap attention computation to hopefully avoid NaN, update docs
* 20B tests
2022-06-30 08:47:40 -04:00
Crystina
692e61e91a
Flax t5 Encoder ( #17784 )
...
* first draft adding Flax-t5-encoder and Flax-mt5-encoder
* imports
* after make fixup
* flax t5 encoder test
* black on test
* make fix-copies
* clean
* all_model_classes -> tuple
* clean test
* is_encoder_decoder=False in t5-enc tester
* remove file docstring before FlaxT5Encoder
* black
* isort
* commit suggestions on src/transformers/models/t5/modeling_flax_t5.py
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* commit suggestions on src/transformers/models/t5/modeling_flax_t5.py
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* Apply suggestions from code review
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* remove _get_encoder_module
* self.decoder_seq_length -> self.encoder_seq_length as t5-enc does not have decoder
* bugfix - self.module_class is class itself, not instance;
* docs for mt5 and t5
* call -> __call__ in t5 doc
* FlaxMT5EncoderModel to TYPE_HINT
* run doc-builder to allow change the files
Co-authored-by: Suraj Patil <surajp815@gmail.com>
2022-06-30 00:49:02 +02:00
Clémentine Fourrier
eb1493b15d
Fix #17893 , removed dead code ( #17917 )
...
* Removed dead position_id code, fix #17893
* Removed unused var
* Now ignores removed (dead) dict key for backward comp
2022-06-29 17:54:26 -04:00
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