Commit Graph

12196 Commits

Author SHA1 Message Date
Matt
be3d6c84cc
Fix expected values for TF-ESM tests (#20680) 2022-12-08 15:26:09 +00:00
Sylvain Gugger
c83703cbdb
Update the list of contributors to reflect current organization (#20603)
* Update the list of contributors to reflect current organization

* Proper indent
2022-12-08 10:05:43 -05:00
Sylvain Gugger
a03f7514db
Fix load from PT-formatted checkpoint in composite TF models (#20661)
* Fix load from PT-formatted checkpoint in composite TF models

* Leave the from_pt part as it was
2022-12-08 09:33:07 -05:00
Jingya HUANG
521da6518f
Fix gpt2 fp16 training when tracing is enabled (#20656)
* ONNX tracing fix

* Remove conditional
2022-12-08 08:55:59 -05:00
Younes Belkada
93b54368f5
[BiT] Small patch fix (#20657)
* patch fix for `fp16`

* use `np` instead
2022-12-08 12:41:33 +01:00
Emmanuel Schmidbauer
0526a075c5
run_speech_recognition_seq2seq.py: add cache_dir param to dataset (#20540) 2022-12-07 18:23:16 +00:00
Cole Howard
fc95386ea1
Add TFBartForSequenceClassification (#20570)
* read to load

* base functionality

* revert init

* fix dummy data

* moving right along

* moving right along

* finally

* cleanup

* pull out comment

* add test

* update docstring for main class

* flake comments and rewriting copies from make repo-consistency`

* remove irrelevant differences/accidental spaces

* put copies back after space removals

* mid

* final test pass

* stray comment

* update test file

* update test file

* fixup

* black

* missed

* black missed one more

* sytle

* add doc update

* fix order of output class

* comment

* Revert "comment"

This reverts commit 03f86b6948.

* remove redundant function, and redundant reshape

* move change out of common

* style

* put common spaces back

* reorder kwargs in output

* doc style
2022-12-07 18:05:39 +01:00
Sanchit Gandhi
77382e918d
[Whisper] Fix forced decoder ids (#20652)
* [Whisper] Fix forced decoder ids

* fix test
2022-12-07 16:44:13 +00:00
Younes Belkada
7c5eaf9e5a
Add dpt-hybrid support (#20645)
* add `dpt-hybrid` support

* refactor

* final changes, all tests pass

* final cleanups

* final changes

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* fix docstring

* fix typo

* change `vit_hybrid` to `hybrid`

* replace dataclass

* add docstring

* move dataclasses

* fix test

* add `PretrainedConfig` support for `backbone_config`

* fix docstring

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* remove `embedding_type` and replace it by `is_hybrid`

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-12-07 17:01:55 +01:00
Julian Mack
3ac040bca1
Updated Trainer args typing (#20655) 2022-12-07 09:57:39 -05:00
xloem
3994c04585
Speed up git-lfs detection on error (#20641)
Prevent read and discard of entire checkpoint file.
2022-12-07 09:51:02 -05:00
Yih-Dar
147fa37fb1
pin TF 2.11 in docker files (#20642)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-07 15:46:48 +01:00
Yih-Dar
cec5f7abd1
Update summarization run_pipeline_test (#20623)
* update summarization run_pipeline_test

* update

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-07 15:46:12 +01:00
Younes Belkada
3e4c9e5c64
[ViTHybrid] + [BiT] cleaner __init__ (#20649)
* cleaner `__init__`

* add docstring for `backbone_config`
2022-12-07 15:35:37 +01:00
Younes Belkada
aac7b0d232
[Trainer] add error when passing 8bitmodels (#20651)
* add error when passing `8bit`models

* fix

* improve message
2022-12-07 15:30:56 +01:00
NielsRogge
d151a8c550
Add BiT + ViT hybrid (#20550)
* First draft

* More improvements

* Add backbone, first draft of ViT hybrid

* Add AutoBackbone

* More improvements

* Fix bug

* More improvements

* More improvements

* Convert ViT-hybrid

* More improvements

* add patch bit

* Fix style

* Improve code

* cleaned v1

* more cleaning

* more refactoring

* Improve models, add tests

* Add docs and tests

* Make more tests pass

* Improve default backbone config

* Update model_type

* Fix more tests

* Add more copied from statements

* More improvements

* Add push to hub to conversion scripts

* clean

* more cleanup

* clean

* replace to

* fix

* Update src/transformers/models/bit/configuration_bit.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix base model prefix

* more cleaning

* get rid of stem

* clean

* replace flag

* Update src/transformers/models/bit/configuration_bit.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Update src/transformers/models/bit/configuration_bit.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* add check

* another check

* fix for hybrid vit

* final fix

* update config

* fix class name

* fix `make fix-copies`

* remove `use_activation`

* Update src/transformers/models/bit/configuration_bit.py

* rm unneeded file

* Add BiT image processor

* rm unneeded file

* add doc

* Add image processor to conversion script

* Add ViTHybrid image processor

* Add resources

* Move bit to correct position

* Fix auto mapping

* Rename hybrid to Hybrid

* Fix name in toctree

* Fix READMEs'

* Improve config

* Simplify GroupNormActivation layer

* fix test + make style

* Improve config

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* remove comment

* remove comment

* replace

* replace

* remove all conv_layer

* refactor norm_layer

* revert x

* add copied from

* last changes + integration tests

* make fixup

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* fix name

* fix message

* remove assert and refactor

* refactor + make fixup

* refactor - add  + sfety checker

* fix docstring + checkpoint names

* fix merge issues

* fix function name

* fix copies

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* fix model checkpoint

* fix doctest output

* vit name on doc

* fix name on doc

* fix small nits

* fixed integration tests

* final changes - slow tests pass

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
Co-authored-by: younesbelkada <younesbelkada@gmail.com>
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-12-07 11:03:39 +01:00
NielsRogge
b610c47f89
[MaskFormer] Add support for ResNet backbone (#20483)
* Add SwinBackbone

* Add hidden_states_before_downsampling support

* Fix Swin tests

* Improve conversion script

* Add id2label mappings

* Add vistas mapping

* Update comments

* Fix backbone

* Improve tests

* Extend conversion script

* Add Swin conversion script

* Fix style

* Revert config attribute

* Remove SwinBackbone from main init

* Remove unused attribute

* Use encoder for ResNet backbone

* Improve conversion script and add integration test

* Apply suggestion

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-12-07 09:42:38 +01:00
Sylvain Gugger
6c1a0b3931
Pin TensorFlow to the next release (#20635) 2022-12-06 18:28:59 -05:00
aws-sangeetha
c95f84700c
Clip floating point constants to bf16 range to avoid inf conversion (#20605)
Co-authored-by: EC2 Default User <ec2-user@ip-172-31-40-169.us-west-2.compute.internal>
2022-12-06 17:25:26 -05:00
Yih-Dar
f68796bd60
Fix natten installation in docker file (#20632)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-06 22:23:06 +01:00
Francisco Kurucz
f821bea0ad
Fix link to speech encoder decoder model in speech recognition readme (#20633) 2022-12-06 15:46:41 -05:00
Steven Liu
4f78bcb287
add missing is_decoder param (#20631) 2022-12-06 12:18:58 -08:00
Sylvain Gugger
7586a1a367
Fix dtype of weights in from_pretrained when device_map is set (#20602) 2022-12-06 12:16:17 -05:00
Yih-Dar
bf9a5882a7
Update some GH action versions (#20537)
* update actions versions

* update actions versions

* update actions versions

* update actions versions

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-06 16:54:40 +01:00
Arthur
acc439ba17
Ci-jukebox (#20613)
* fix cuda OOM by using single Prior

* only send to device when used

* use custom model

* Skip the big slow test

* Update tests/models/jukebox/test_modeling_jukebox.py

Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>

Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2022-12-06 16:14:03 +01:00
Yih-Dar
9b14c1b6bf
Fix AutomaticSpeechRecognitionPipelineTests.run_pipeline_test (#20597)
* Remove assert exception not triggered

* Fix wrong expected exception string

* fix

* use assertRaisesRegex

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-06 15:48:49 +01:00
Sylvain Gugger
6a707cf586
Repo consistency 2022-12-06 08:08:37 -05:00
Sourab Mangrulkar
97a51b0c7d
updating T5 and BART models to support Prefix Tuning (#20601)
* updating T5 and BART models to support Prefix Tuning

* `make fix-copies`

* address comments

* address comments
2022-12-06 18:24:39 +05:30
xxyzz
b9a0ede6ab
Check if docstring is None before formating it (#20592)
docstrings could be `None` if Python optimize level is set to 2.
2022-12-06 07:44:17 -05:00
Wang, Yi
ae06bce888
exclude jit time from the speed metric calculation of evaluation and prediction (#20553)
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
2022-12-06 07:37:01 -05:00
Sourab Mangrulkar
25e10da427
Adding anchor links to Hindi README (#20606) 2022-12-06 18:06:25 +05:30
Samuel Xu
e842e181df
Documentation fixes (#20607) 2022-12-06 07:32:46 -05:00
Nicolas Patry
28f3d431d4
Rework the pipeline tutorial (#20437)
* [WIP] Rework the pipeline tutorial

- Switch to `asr` instead of another NLP task.
- It also has simpler to understand results.
- Added a section with interaction with `datasets`.
- Added a section with writing a simple webserver.

* Apply suggestions from code review

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Addressing comments.

* Links.

* Fixing docs format.

* Adding pipeline_webserver to _toctree.

* Warnig -> Tip warnings={true}.

* Fix link ?

* Links ?

* Fixing link, adding chunk batching.

* Oops.

* Apply suggestions from code review

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/pipeline_tutorial.mdx

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2022-12-06 10:47:31 +01:00
Sylvain Gugger
5764efe544
Fix test for file not found (#20604) 2022-12-05 18:33:56 -05:00
Steven Liu
720e9599c1
Split autoclasses on modality (#20559)
* split autoclasses on modality

* apply review

* auto classes
2022-12-05 12:28:44 -08:00
Steven Liu
7d1c1c5b21
Fix code sample in preprocess (#20561)
* change to image_processor

* apply review
2022-12-05 11:49:43 -08:00
Sourab Mangrulkar
73ec12eafb
README in Hindi 🇮🇳 (#20097)
* Created README_hd.md

A Hindi Translation for README

* updated check_copies.py

Added the Proper info for Hindi Translation of README File !

* updated README_hd.md

Fixed some translation issues !

* Update README_hd.md

* Update README_hd.md

* Update README_hd.md

* fixing 🐛 for `make fix-copies`

* run `make fix-copies`

* `make fix-copies` 😅

Co-authored-by: Akshit Gulyan <103456810+AkshitGulyan@users.noreply.github.com>
2022-12-06 01:04:40 +05:30
Arthur
aef9aac312
Add-whisper-conversion (#20600)
* add whisper conversion scrip

* update conversion script

* update arg names

* fix missing encoder_ffn_dim

* fixup

* ast nits
2022-12-05 20:02:57 +01:00
Sanchit Gandhi
74fb524e20
[Whisper] Fix decoder ids methods (#20599)
* [Whisper] Fix decoder ids methods

* enum property
2022-12-05 18:45:22 +00:00
Younes Belkada
ef0f85cd57
[Vision] .to function for ImageProcessors (#20536)
* add v1 with tests

* add checker

* simplified version

* update docstring

* better version

* fix docstring + change order

* make style

* tests + change conditions

* final tests

* modify docstring

* Update src/transformers/feature_extraction_utils.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

* replace by `ValueError`

* fix logic

* apply suggestions

* `dtype` is not needed

* adapt suggestions

* remove `_parse_args_to_device`

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
2022-12-05 19:10:54 +01:00
Yih-Dar
67d32f4649
Replace set-output by $GITHUB_OUTPUT (#20547)
* remove set-output

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 18:25:13 +01:00
Arthur
9763f829a5
Fix whisper and speech to text doc (#20595)
* Fix whisper and speech to text doc
# What does this PR do?
Previously the documentation was badly indented for both models and indicated that
> If `decoder_input_ids` and `decoder_inputs_embeds` are both unset, `decoder_inputs_embeds` takes the value of `inputs_embeds`.`
Which is on valid for the forward pass of the `ForConditionnalGeneration` not for the model alone.

* other fixes
2022-12-05 18:23:36 +01:00
Yih-Dar
4430b91298
clean up unused classifier_dropout in config (#20596)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 18:04:33 +01:00
Francisco Kurucz
eefae413d1
Fix link to table transformer detection microsoft model (#20560)
* Fix link to table transformer detection microsoft model

* Fix doc styles
2022-12-05 11:43:27 -05:00
Francisco Kurucz
d5af5a0c87
Fix link to swin transformers v2 microsoft model (#20558) 2022-12-05 11:43:04 -05:00
Francisco Kurucz
ac3bccdc74
Fix link to Swin Model contributor novice03 (#20557) 2022-12-05 11:42:29 -05:00
Erin
87282cb73c
Add RemBERT ONNX config (#20520)
* rembert onnx config

* formatting

Co-authored-by: Ho <erincho@bcd0745f972b.ant.amazon.com>
2022-12-05 11:39:09 -05:00
Matthew Hoffman
afe2a466bb
ESM openfold_utils type hints (#20544)
* add type annotations for esm chunk_utils

use isinstance builtin instead of 'type(x) is y'; add assertions to aid in type inferencing; use bools instead of ints in _get_minimal_slice_set for improved type clarity; refactor to avoid re-assigning to the same variable with a different type

* add type annotations for esm data_transforms

refactor to avoid re-assigning to the same variable with a different type

* add type annotations for esm feats utils

refactor to avoid re-assigning to the same variable with a different type

* add type annotations for esm loss utils

* add/fix type annotations for esm rigit_utils

refactor to avoid re-assigning to the same variable with a different type; fix Callable, Tuple type hints; match conditional structure to other methods; fix return type on Rotation.cat and Rotation.unsqueeze

* add type annotations for esm tensor_utils

overload for tree_map; use insinstance builtin instead of 'type(x) is y'; export dict_multimap, flatten_final_dims, permute_final_dims in openfold_utils

* add type annotations for esm protein utils

add FIXME for attempted string mutation; add missing None check in get_pdb_headers; fix potentially unbound variable 'chain_tag' in to_pdb; modify get_pdb_headers return type

* add type annotations for esm residue constants

hints on collection constants; remove magic trailing comma to reduce number of lines; change list -> tuple for rigid_group_atom_positions for improved hinting

* code style fixup

Co-authored-by: Matt <rocketknight1@gmail.com>
2022-12-05 16:23:15 +00:00
Mihai Cernusca
8ea6694d92
Make convert_to_onnx runable as script again (#20009)
* Make convert_to_onnx runable as script again

Fix `convert_graph_to_onnx.py` relative import so it can be run as a script again.

* Trigger CI
2022-12-05 11:08:39 -05:00
Arthur
84c9bf7421
cross platform from_pretrained (#20538)
* add support for `from_pt`

* add tf_flax utility file

* Update src/transformers/modeling_tf_flax_utils.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* remove flax related modifications

* add test

* remove FLAX related commits

* fixup

* remove safetensor todos

* revert deletion

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-12-05 16:56:17 +01:00