Commit Graph

9274 Commits

Author SHA1 Message Date
NielsRogge
03c14a515f
[Tests] Fix DiT test (#16218)
* Fix device

* Clean up

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-03-17 10:53:57 +01:00
Lysandre Debut
73f0a5d1f6
Fixes Loss for TransfoXL when using Trainer API v2 (#16140)
* fix(transfo_xl): Fixes TransfoXL support when using Trainer.

* fix(tests): Uses losses_1 and losses_2 pattern with TransfoXL test.

* fix(transfo_xl): Adds requested changes to allow for backward compatibility.

fix(transfo_xl): Adds requested changes to allow for backward compatibility.

fix(transfo_xl): Fixes code styling.

* Backward compatibility

* Update src/transformers/models/transfo_xl/modeling_transfo_xl.py

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

Co-authored-by: Gustavo de Rosa <gth.rosa@uol.com.br>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-03-17 05:49:24 -04:00
Francesco Saverio Zuppichini
76c74b37c1
VAN: update modules names (#16201)
* done

* done
2022-03-17 10:25:09 +01:00
João Gustavo A. Amorim
99e2982f3e
Add/type annotations/model vision (#16151)
* add types annotations for Beit (PyTorch)

* add types annotations for ViT (PyTorch)

* add types annotations for Deit (PyTorch)

* change Optional[bool] to bool into some places at Beit

* change Optional[bool] to bool into some places at ViT
2022-03-16 20:27:54 +00:00
Patrick von Platen
2410d0f8ed
Fix generation min length (#16206)
* up

* fix min lengths
2022-03-16 18:49:23 +01:00
Francesco Saverio Zuppichini
667b823b89
Swin support for any input size (#15986)
* padding done

* correctly return one attention per layer

* almost correct, attentions are not flatten one tuple per stage

* tests green

* doc

* conversations

* reshaping hidden_states

* view in the test

* reshape_hidden_states in Encoder and Model

* new outputs with reshaped_hidden_states

* conversations

* doc

* Update docs/source/model_doc/swin.mdx

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>

* conversations

* fix tests

* minor changes

* resolved conversations

* attentions one per stage

* typo

* typos

* typos

* function signature

* CI

* clean up tests

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
2022-03-16 18:38:25 +01:00
Joao Gante
204c54d411
TF: add beam search tests (#16202) 2022-03-16 15:44:33 +00:00
Suraj Patil
190994573a
Fix loading CLIPVisionConfig and CLIPTextConfig (#16198)
* override from_pretrained

* add tests

* remove docstrings

* fix typo

* Trigger CI
2022-03-16 16:24:01 +01:00
Yih-Dar
09013efdf1
Update step name (#16189)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-03-16 11:19:38 -04:00
Francesco Saverio Zuppichini
36f8c42519
ResNet: update modules names (#16196)
* updated names

* fit in one line

* typo
2022-03-16 15:59:56 +01:00
John Ryan
5bdf3313ef
Adding type hints for Distilbert (#16090)
* Distillbert type - squash

* Update src/transformers/models/distilbert/modeling_distilbert.py

Undo cleanup

Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>

* Update src/transformers/models/distilbert/modeling_distilbert.py

Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>

* Update src/transformers/models/distilbert/modeling_distilbert.py

Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>

* Update src/transformers/models/distilbert/modeling_distilbert.py

Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>

* Remove type

Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>
2022-03-16 14:54:50 +00:00
Utku Saglam
0b8b06185d
clearer model variable naming: blenderbot_small (#16194)
Co-authored-by: utku saglam <utkusaglam@utku-MacBook-Pro.local>
2022-03-16 14:03:58 +00:00
Johannes Kolbe
f06c2c2ba1
TF unpack_input decorator for convnext (#16181)
* unpack_input decorator for tf_convnext

* set unpack_input as top decorator

Co-authored-by: Johannes Kolbe <johannes.kolbe@tech.better.team>
2022-03-16 14:01:32 +00:00
Anton Lozhkov
d35e0c6247
Minor fixes to XTREME-S (#16193)
* Minor fixes

* Fix vocab union

* Update examples/research_projects/xtreme-s/README.md

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

* Update README

* unused import

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-03-16 17:23:00 +04:00
Utku Saglam
8cc925a241
TF clearer model variable naming: blenderbot (#16192)
Co-authored-by: utku saglam <utkusaglam@utku-MacBook-Pro.local>
2022-03-16 12:37:08 +00:00
Utku Saglam
0f35cda459
TF clearer model variable naming: funnel (#16178)
Co-authored-by: utku saglam <utkusaglam@utku-MacBook-Pro.local>
2022-03-16 10:37:47 +00:00
Sanchit Gandhi
ee27b3d7df
Replace all deprecated jax.ops operations with jnp's at (#16078)
* Replace all deprecated `jax.ops` operations with jnp's `at`

* np to jnp scores

* suggested changes
2022-03-16 09:08:55 +00:00
Patrick von Platen
c2dc89be62
[Xtreme-S] fix some namings (#16183) 2022-03-16 01:21:31 +01:00
Anton Lozhkov
99fd3eb4a5
Add the XTREME-S fine-tuning example (#15985)
* CTC+classification draft

* CTC+classification draft

* style

* multilingual runs

* Fix race condition during processor.from_reatrained

* Merge covost experiments

* Add README

* Quality

* Switch to .all configs

* Fix typos
2022-03-16 00:21:06 +01:00
Sylvain Gugger
db4dd44ae3 Trigger doc build 2022-03-15 17:00:31 -04:00
Yih-Dar
ea05d67164
Fix some Flax models' hidden_states (#16167)
* fix the last element in `hidden_states`

* fix missing elements in outputs for FlaxWav2Vec2EncoderLayerStableLayerNormCollection

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-03-15 19:06:46 +01:00
Dan Tegzes
88f7c564f0
Added type hints for Reformer (#16175) 2022-03-15 17:59:59 +00:00
Jack McDonald
16399d6197
Add type annotations for Perceiver (#16174) 2022-03-15 17:56:57 +00:00
Kamal Raj
015de6f081
TF clearer model variable naming: xlnet (#16150) 2022-03-15 17:50:30 +00:00
Thomas Chaigneau
a23a7c0cd6
Add flaubert types (#16118)
* Add type hints for FlauBERT PyTorch Base model. Others downstream tasks are inherited from XLM RoBERTa.

* Add type hints for FlaubERT Tensorflow models.

* fix output for TFFlaubertWithLMHeadModel
2022-03-15 16:57:45 +00:00
Kamal Raj
366c18f473
TF clearer model variable naming: Deberta (#16146) 2022-03-15 16:53:25 +00:00
Kamal Raj
79465ac521
TF clearer model variable naming: Tapas (#16145) 2022-03-15 16:52:56 +00:00
Suraj Patil
a78565b7aa
[MT5Config] add relative_attention_max_distance in config (#16170) 2022-03-15 16:26:52 +01:00
Sylvain Gugger
4f4e5ddbcb
Framework split (#16030)
* First files

* More files

* Last files

* Style
2022-03-15 10:13:34 -04:00
mowafess
4a353cacb7
added type hints to yoso (#16163) 2022-03-15 14:04:32 +00:00
Joydeep Bhattacharjee
c1c17bd0b3
update transformer XL with tf decorator (#16166)
* update transformer XL with tf decorator

* code fixup

* remove unused variables
2022-03-15 14:00:18 +00:00
Minh Chien Vu
611d3a09b2
Change unpacking of TF inputs: layoutlm, mpnet, rag, and roformer (#16112)
Co-authored-by: ChienVM <chien_vm@detomo.co.jp>
2022-03-15 13:47:45 +00:00
Kamal Raj
0d7322c1b7
TF clearer model variable naming: pegasus (#16152) 2022-03-15 13:45:59 +00:00
Matt
cd4c5c9060
TF XLA greedy generation (#15786)
* First attempt at TF XLA generation

* Fix comments

* Update XLA greedy generate with direct XLA calls

* Support attention mask, prepare_inputs_for_generation no longer hardcoded for greedy

* Handle position_ids correctly

* make xla generate work for non xla case

* force using xla generate

* refactor

* more fixes

* finish cleaning

* finish

* finish

* clean gpt2 tests

* add gpt2 tests

* correct more cases

* up

* finish

* finish

* more fixes

* flake 8 stuff

* final rag fix

* Update src/transformers/models/rag/modeling_tf_rag.py

* finish t5 as well

* finish

* Update src/transformers/generation_utils.py

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-03-15 14:19:20 +01:00
Yih-Dar
e5bc438cc8
[Fix doc example] Fix 2 PyTorch Vilt docstring examples (#16076)
* fix 2 pytorch vilt docstring examples

* add vilt to doctest list file

* remove device

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-03-15 13:35:02 +01:00
Markus Sagen
bcaf566038
[Fix doc example] Fix first example for the custom_datasets tutorial (#16087)
* Fix inconsistent example variable naming

- Example code for a sequence classification in Tensorflow had spelling mistakes and incorrect and inconsistent naming
- Changed variable naming to be consistent with the two other TF examples

* Fix incorrect incorrect training examples
2022-03-15 08:17:51 -04:00
Sylvain Gugger
8bfd2fb8f0
Use templates (#16142)
* Use tempaltes for all doc building jobs

* Add this branch to the doc build

* Switch to main branch
2022-03-15 08:07:56 -04:00
Daniel Espejel
daa4944759
Added spanish translation of quicktour.mdx (#16158)
* Added spanish translation of quicktour.mdx

* Suggestions applied in the revision of the translation

Co-authored-by: Omar U. Espejel <espejelomar@gmail.com>

Co-authored-by: Omar U. Espejel <espejelomar@gmail.com>
2022-03-15 08:07:35 -04:00
Ahmed Elnaggar
57713443de
Configurable Relative Position Max. Distance (#16155)
* Configurable Relative Position Max. Distance

* fix missing config

Co-authored-by: ahmed-elnaggar <ahmed.elnaggar@allianz.com>
2022-03-15 08:05:33 -04:00
marxav
cd1ffb40bf
typo "conaining" -> "containing" (#16132) 2022-03-15 07:08:53 -04:00
Patrick von Platen
5664d27622
Shift responsibilities a bit (#16154) 2022-03-15 11:07:17 +01:00
Pavel Belevich
5a386fb05c
Make transformers.utils.fx. _SUPPORTED_MODELS unique (#16015) 2022-03-15 10:15:03 +01:00
NielsRogge
a7aca42fc4
Improve Swin for VisionEncoderDecoder (#16070)
* Add Swin2Bart test

* Fix swin tests

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-03-15 09:59:48 +01:00
Francesco Saverio Zuppichini
0a057201a9
Visual Attention Network (VAN) (#16027)
* encoder works

* addded files

* norm in stage

* convertion script

* tests

* fix copies

* make fix-copies

* fixed __init__

* make fix-copies

* fix

* shapiro test needed

* make fix-copie

* minor changes

* make style + quality

* minor refactor conversion script

* rebase + tests

* removed unused variables

* updated doc

* toctree

* CI

* doc

* Apply suggestions from code review

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

* resolved conversations

* make fixup

* config passed to modules

* config passed to modules

* Apply suggestions from code review

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

* conversations

* conversations

* copyrights

* normal test

* tests

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
2022-03-15 08:47:12 +01:00
Dan Tegzes
8f3ea7a1e1
Add type hints for GPTNeo PyTorch (#16127)
* Add type hints for SqueezeBert PyTorch

* Add type hints for GPTNeo PyTorch

* style fixes

* chenged List with Tuple
2022-03-14 20:26:12 +01:00
Francesco Saverio Zuppichini
e3008c679f
[WIP] Resnet (#15770)
* first commit

* ResNet model correctly implemented.

basic modeling + weights conversion is done

removed unused doc

mdx file

doc and conversion script

added feature_extractor to auto

test

minor changes + style + quality

doc

test

Delete process.yml

A left over from my attempt of running circleci locally

* minor changes

* Apply suggestions from code review

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

* new test format

* minor changes from conversations

* minor changes from conversations

* make style + quality

* readded the tests

* test + README

* minor changes from conversations

* error in README

* make fix-copies

* removed regression for classification head

* make quality

* fixed loss control flow

* fixed loss control flow

* resolved conversations

* Apply suggestions from code review

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

* READMEs

* index.mdx

* minor changes

* updated tests and models

* unused import

* outputs

* Update docs/source/model_doc/resnet.mdx

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

* added embeddings_size

* Apply suggestions from code review

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

* conversation

* added push to hub

* test

* embedding_size

* make fix-copies

* resolved conversations

* CI

* changed organization

* minor changes

* CI

* minor changes

* conversations

* conversation

* doc

* tests

* removed unused docstring

* conversation

* removed unused outputs

* CI

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
2022-03-14 19:57:55 +01:00
Kamal Raj
6458236181
TF Electra - clearer model variable naming (#16143) 2022-03-14 18:10:07 +00:00
Joydeep Bhattacharjee
37793259bb
update albert with tf decorator (#16147) 2022-03-14 18:09:19 +00:00
Sylvain Gugger
e109edf16f
Use HF_ENDPOINT for custom endpoints (#16139) 2022-03-14 13:26:23 -04:00
Martin Pan
0dcdfe8630
Add type hints for FNet PyTorch (#16123) 2022-03-14 17:11:19 +00:00