NielsRogge
9f0c72f93b
Add doc tests ( #20158 )
...
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MBP.localdomain>
2022-11-10 15:25:30 +01:00
Joao Gante
f270b960d6
Generate: move generation_*.py src files into generation/*.py ( #20096 )
...
* move generation_*.py src files into generation/*.py
* populate generation.__init__ with lazy loading
* move imports and references from generation.xxx.object to generation.object
2022-11-09 15:34:08 +00:00
Weiwe Shi
efa889d2e4
Add RocBert ( #20013 )
...
* add roc_bert
* update roc_bert readme
* code style
* change name and delete unuse file
* udpate model file
* delete unuse log file
* delete tokenizer fast
* reformat code and change model file path
* add RocBertForPreTraining
* update docs
* delete wrong notes
* fix copies
* fix make repo-consistency error
* fix files are not present in the table of contents error
* change RocBert -> RoCBert
* add doc, add detail test
Co-authored-by: weiweishi <weiweishi@tencent.com>
2022-11-08 10:03:43 -05:00
NielsRogge
258963062b
Add CLIPSeg ( #20066 )
...
* Add first draft
* Update conversion script
* Improve conversion script
* Improve conversion script some more
* Add conditional embeddings
* Add initial decoder
* Fix activation function of decoder
* Make decoder outputs match original implementation
* Make decoder outputs match original implementation
* Add more copied from statements
* Improve model outputs
* Fix auto tokenizer file
* Fix more tests
* Add test
* Improve README and docs, improve conditional embeddings
* Fix more tests
* Remove print statements
* Remove initial embeddings
* Improve conversion script
* Add interpolation of position embeddings
* Finish addition of interpolation of position embeddings
* Add support for refined checkpoint
* Fix refined checkpoint
* Remove unused parameter
* Improve conversion script
* Add support for training
* Fix conversion script
* Add CLIPSegFeatureExtractor
* Fix processor
* Fix CLIPSegProcessor
* Fix conversion script
* Fix most tests
* Fix equivalence test
* Fix README
* Add model to doc tests
* Use better variable name
* Convert other checkpoint as well
* Update config, add link to paper
* Add docs
* Update organization
* Replace base_model_prefix with clip
* Fix base_model_prefix
* Fix checkpoint of config
* Fix config checkpoint
* Remove file
* Use logits for output
* Fix tests
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-11-08 10:55:47 +01:00
Saad Mahmud
9617b1304e
[Doctest] Add configuration_dpr.py ( #20080 )
...
* Add example docstring for DPRConfig
* Add DPRConfig to documentation_tests
2022-11-07 14:49:59 +01:00
Saad Mahmud
790ff2544a
[Doctest] Add configuration_camembert.py ( #20039 )
...
* Add example docstring for CamembertConfig
* Add configuration_camembert to documentation_tests
2022-11-03 14:50:42 +01:00
Saad Mahmud
7487743793
[Doctest] Add configuration_deberta_v2.py ( #19995 )
...
* Add example docstring for DebertaV2Config
* Add DebertaV2Config to documentation_tests
* Fix mistake with directory name
2022-11-02 16:22:11 +01:00
Saad Mahmud
6176e13612
[Doctest] Add configuration_deberta.py ( #19968 )
...
* Add Example docstring to DebertaConfig
* Add configuration_deberta to documentation_tests
* Add microsoft/deberta-base to example docstring
* Fix example docstring mistake
2022-10-31 17:22:01 +01:00
Revanth09
1f1cc09df6
[DOCTEST] Config doctest for MCTCT
, MBart
and LayoutLM
( #19889 )
...
* Update documentation_tests.txt
* Update configuration_mbart.py
* Update configuration_mctct.py
* Update configuration_layoutlm.py
* Update configuration_layoutlmv2.py
* Update configuration_layoutlmv3.py
* Update documentation_tests.txt
2022-10-26 12:05:44 +02:00
Ayaka
536f338441
[Doctest] Add configuration_nezha.py
( #19810 )
...
* [Doctest] Add `configuration_nezha.py`
* Revert line order
2022-10-24 13:50:43 +02:00
Ayaka
f58b211ed3
[Doctest] Add configuration_electra.py
( #19807 )
2022-10-24 12:34:43 +02:00
Ayaka
c949188b9d
[Doctest] Add configuration_poolformer.py
( #19808 )
2022-10-24 12:33:46 +02:00
Ayaka
82df83a96b
[Doctest] Add configuration_plbart.py
( #19809 )
...
Additionally, I updated the doctest format to be consistent with BERT.
2022-10-24 12:32:55 +02:00
sha016
22502ebb85
[Doctest] MaskFormerConfig
doctest ( #19817 )
2022-10-24 11:08:32 +02:00
Rohith ND
eb98da9880
[Doctest] OpenAIGPTConfig and OPTConfig ( #19763 )
2022-10-20 10:22:00 +02:00
Partho
506355ca75
[Doctest] SpeechToTextTransformer2 Config for doctest ( #19756 )
2022-10-20 10:19:06 +02:00
Partho
123f65eea6
[Doctest] SqueezeBERT Config for doctest ( #19758 )
2022-10-20 10:16:39 +02:00
Partho
cc03063366
[Doctest] SpeechToTextTransformer Config for doctest ( #19757 )
2022-10-20 10:15:07 +02:00
Xabier Lahuerta Vazquez
0a03741590
[Doctest] Add configuration_detr.py
( #19752 )
2022-10-19 18:13:34 +02:00
Xabier Lahuerta Vazquez
65d36ee861
[Doctest] Add configuration_decision_transformer.py
( #19751 )
2022-10-19 18:12:34 +02:00
JuanCarlosPi
c206fc8779
[Doctest] Add configuration_wavlm.py
( #19749 )
...
* Change the import order of the model and configuration classes
* Add (with random weights) in the comment before model initialization
* Add configuration_wavlm to doctest
2022-10-19 16:10:13 +02:00
Rohith ND
7df0751cc6
[Doctest] GPTNeoConfig , GPTNeoXConfig , GPTNeoXJapaneseConfig ( #19741 )
2022-10-19 14:22:41 +02:00
Partho
fc5fdc109d
[Doctest] Add configuration_clip.py
( #19647 )
...
* CLIP Config for doctest
* add doc example to CLIPConfig
* add from_text_vision_configs example
* added comment explaining objective
2022-10-19 09:51:26 +02:00
AymenBer99
c9a0da1e12
[Doctest] XLM Config for doctest ( #19685 )
2022-10-19 07:10:30 +02:00
JuanCarlosPi
eccbdbcd4d
[Doctest] Add wav2vec2_conformer for doctest ( #19734 )
2022-10-19 06:47:41 +02:00
Rohith ND
fa8ed9ca76
[Doctest] Add doctest for FlavaConfig
and FNetConfig
( #19724 )
2022-10-18 19:56:49 +02:00
Mukesh K
f3ed26a3fb
[Doctest] Fixing doctest configuration_pegasus_x.py
( #19725 )
...
* Fixed pegasus_x config doctest
* Test commit
Co-authored-by: mukesh663 <mukesh13034@gmail.com>
2022-10-18 17:19:31 +02:00
Somasree Majumder
5864051109
[Doctest] Adding config files for convnext ( #19717 )
...
* Adding config files for configuration_clip.py
* Adding config files for convnext
* Undoing
* making the required changes
* Update documentation_tests.txt
2022-10-18 17:10:09 +02:00
Mukesh K
fac1f4b188
]Fixed pegasus config doctest ( #19722 )
...
Co-authored-by: mukesh663 <mukesh13034@gmail.com>
2022-10-18 15:38:57 +02:00
NielsRogge
dd523da577
Add table transformer [v2] ( #19614 )
...
* First draft
* Add conversion script
* Make conversion work
* Upload checkpoints
* Add final fixes
* Revert changes of conditional and deformable detr
* Fix toctree, add and remove copied from
* Use model type
* Improve docs
* Improve code example
* Update copies
* Add copied formt
* Don't update conditional detr
* Don't update deformable detr
2022-10-18 15:20:09 +02:00
JuanCarlosPi
fd99ce3329
[Doctest] Add configuration_wav2vec2.py to documentation_tests.py ( #19698 )
2022-10-18 14:57:34 +02:00
AymenBer99
8fcbbd3d53
[Doctest] CVT config for doctest ( #19695 )
2022-10-18 14:55:56 +02:00
Partho
2add2007c1
[Doctest] Add configuration_data2vec_vision.py
( #19637 )
...
* Data2Vec Vision Config for doctest
* made suggested changes
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2022-10-17 20:56:42 +02:00
Akshita Prasanth
684165b882
[Doctest] Add configuration_realm.py ( #19646 )
...
* Update configuration_realm.py
* realm config for doctest
* Update configuration_realm.py doc
* Update documentation_tests
* clean up
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-10-17 20:53:24 +02:00
AymenBer99
5ac2f82267
[Doctest] Add configuration_convbert.py ( #19643 )
...
* ConvBERT config for doctest
* Add empty lines
2022-10-17 20:29:18 +02:00
Partho
4d77f18cba
[Doctest] Data2VecAudio Config for doctest ( #19635 )
2022-10-17 18:39:15 +02:00
Thomas
0027edf905
[Doctest] Add configuration_transfo_xl.py ( #19651 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-10-17 16:47:54 +02:00
Thomas
9bb26f2505
[Doctest] Add configuration_trocr.py
( #19658 )
...
* trocr Config for doctest
* ran make style
2022-10-17 10:53:36 +02:00
AymenBer99
c06a5a3101
[Doctest] XLNet config for doctest ( #19649 )
2022-10-17 10:45:37 +02:00
AymenBer99
57505b1def
[Doctest] Conditional DETR config for doctest ( #19641 )
2022-10-17 10:42:55 +02:00
Partho
339c5a5d9a
[Doctest] Add configuration_data2vec_text.py
( #19636 )
...
* Data2Vec Text Config for doctest
* typo fix
* made suggested changes
2022-10-17 10:34:33 +02:00
AymenBer99
dd464e22a7
[Doctest] CodeGen config for doctest ( #19633 )
2022-10-15 12:35:35 +02:00
Sujay
8fcf562603
[Doctest] Add configuration_time_series_transformer.py ( #19582 )
...
* initial changes
* update the suggested order of import
2022-10-14 19:39:56 +02:00
Sujay
31cfe9c429
[Doctest] Add configuration_vision_encoder_decoder.py ( #19583 )
...
* adds vision_encoder_decoder to Doc tests
* keep the initial order
2022-10-14 19:30:14 +02:00
Sujay
7972f995b3
[Doctest] Add configuration_vision_text_dual_encoder.py ( #19580 )
...
* initial commit
* few suggested changes
2022-10-14 18:45:15 +02:00
Partho
66dd80213c
[Doctest] Add configuration_resnet.py
( #19620 )
...
* ResNet Config for doctest
* added empty lines as suggested
* ran make style
2022-10-14 18:10:17 +02:00
Partho
585f9c6d9e
[Doctest] DistilBERT Config for doctest ( #19621 )
2022-10-14 17:22:29 +02:00
Partho
96f243c399
[Doctest] LeViT Config for doctest ( #19622 )
2022-10-14 17:21:24 +02:00
Jing Hua
78c1e7d253
xlm roberta xl config for doctest ( #19610 )
...
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-14 11:04:10 -04:00
Jing Hua
10ea45b902
Ernie config for doctest ( #19611 )
2022-10-14 10:57:51 -04:00
Jing Hua
637af90d7f
xlm roberta config for doctest ( #19609 )
2022-10-14 10:48:38 -04:00
Jing Hua
f8244014a5
Visual Bert config for doctest ( #19605 )
2022-10-14 10:45:37 -04:00
NielsRogge
4f0337a08f
[Time Series Transformer] Add doc tests ( #19607 )
...
* Add doc tests
* Make it more consistent
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-10-14 15:57:03 +02:00
Xabier Lahuerta Vazquez
909f07092a
[Doctest] Add configuration_bigbird_pegasus.py
and configuration_big_bird.py
( #19606 )
...
* [Doctest] Add `configuration_bigbird_pegasus.py` and `configuration_big_bird`
[Doctest] Re-style `configuration_big_bird.py`
* [Doctest] One python instruction per line
* [Doctest] Fix styling
* [Doctest] More styling fixes
2022-10-14 15:17:36 +02:00
RamitPahwa
7036c956fe
[Doctest] fix doc test for megatron bert ( #19600 )
2022-10-14 12:08:55 +02:00
Partho
c7d1fb6964
[Doctest] SEW-D Config for doctest ( #19598 )
2022-10-14 12:07:32 +02:00
Partho
0ac6b90563
[Doctest] UniSpeech Config for doctest ( #19596 )
2022-10-14 12:03:35 +02:00
Partho
71a27e3952
[Doctest] SEW Config for doctest ( #19597 )
2022-10-14 11:47:29 +02:00
Partho
e64798296f
[Doctest] Swin Config for doctest ( #19594 )
2022-10-14 11:37:37 +02:00
Partho
7178b29a8e
[Doctest] Swin V2 Config for doctest ( #19595 )
2022-10-14 11:16:38 +02:00
KaranGarg
76b4239ec8
[Doctests] add configuration_blenderbot_small.py
( #19589 )
...
* yoso config for doctest
* Revert "yoso config for doctest"
This reverts commit eae128d6f1
.
* add configurations_blenderbot_small.py for doctests
2022-10-14 09:42:29 +02:00
Sujay
3d320c78c3
[Doctest] adds trajectory_transformer config to Docs test ( #19586 )
2022-10-13 19:07:10 +02:00
KaranGarg
1f6a28c71c
[Doctests] add configuration_blenderbot.py
( #19577 )
...
* yoso config for doctest
* Revert "yoso config for doctest"
This reverts commit eae128d6f1
.
* add configurations.blenderbot.py for doctests
* add configuration.blenderbot for doctest
2022-10-13 18:46:12 +02:00
KaranGarg
7180e17256
[Doctests] Config files for ViTMAE
and YOSO
( #19567 )
2022-10-13 15:05:02 +02:00
Isaac Omolayo
05a287ec1a
[Doctest] Add configuration_canine.py ( #19575 )
2022-10-13 14:12:49 +02:00
imarekkus
117098421c
[Doctest] CTRL config ( #19574 )
2022-10-13 14:10:04 +02:00
imarekkus
0903fc80b5
[Doctest] bloom config update ( #19566 )
2022-10-13 12:14:38 +02:00
Partho
0ae3ec5b9d
[Doctest] Add configuration_vit.py
( #19561 )
...
* ViT Config for doctest
2022-10-13 12:07:14 +02:00
Partho
f173ceefc0
[Doctest] RoBERTa Config for doctest ( #19563 )
2022-10-13 12:06:18 +02:00
Partho
2719599a22
[Doctest] Reformer Config for doctest ( #19562 )
2022-10-13 12:03:15 +02:00
Partho
4a3578f23f
[Doctest] DeiT Config for doctest ( #19560 )
2022-10-13 12:02:40 +02:00
Vishwas
f4b386765d
[Doctest] Fixing doctest bert_generation configuration ( #19558 )
...
* Added (with random weights) in the comment before model initialization line
* Added configuration_bert_generation.py to utils/documentation_tests.txt
Co-authored-by: vishwaspai <vishwas.pai@emplay.net>
2022-10-13 11:59:02 +02:00
RamitPahwa
1d4d9dc3c9
[Doctest] Fixing mobile bert configuration doctest ( #19557 )
...
* Fixing mobile bert configuration doctest
* Fixed build failures by removing empty line
2022-10-13 11:56:35 +02:00
RamitPahwa
3ae21936e5
[Doctest] Fixing the Doctest for imageGPT config ( #19556 )
2022-10-13 11:54:35 +02:00
Partho
ef5899bf34
[Doctest] GPT2 Config for doctest ( #19549 )
2022-10-13 05:58:59 +02:00
Partho
6cd8676cf3
[Doctest] Beit Config for doctest ( #19542 )
2022-10-12 20:38:13 +02:00
Partho
383ad81e68
[Doctest] Add configuration_whisper.py
( #19540 )
...
* Whisper Config for doctest
* restyle fix
2022-10-12 14:03:22 -04:00
imarekkus
4a5d63c958
Albert config update ( #19541 )
2022-10-12 14:02:55 -04:00
Partho
51d21b7619
[Doctest] Add configuration_yolos.py
( #19539 )
...
* YOLOS Config for doctest
* fix
2022-10-12 14:01:25 -04:00
NielsRogge
9e29080439
[X-CLIP] Fix doc tests ( #19523 )
...
* Fix XCLIP doc tests
* Add model to doc test list
* Fix tests
2022-10-12 17:05:12 +02:00
imarekkus
3ccda6d0b0
[Doctest] Bart configuration update ( #19524 )
...
* Update configuration_bart.py
* Update documentation_tests.txt
* Update documentation_tests.txt
Putting this line in a sorted order
2022-10-12 15:11:46 +02:00
NielsRogge
4d367a3c81
Add LiLT ( #19450 )
...
* First draft
* Fix more things
* Improve more things
* Remove some head models
* Fix more things
* Add missing layers
* Remove tokenizer
* Fix more things
* Fix copied from statements
* Make all tests pass
* Remove print statements
* Remove files
* Fix README and docs
* Add integration test and fix organization
* Add tips
* Apply suggestions from code review
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Make tests faster, improve docs
* Fix doc tests
* Add model to toctree
* Add docs
* Add note about creating new checkpoint
* Remove is_decoder
* Make tests smaller, add docs
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-12 10:11:20 +02:00
Yih-Dar
e2dc558e9c
[Doctest] Add configuration_bert.py
to doctest ( #19485 )
...
* BertConfig for doctest
* Change import order
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-10-12 09:44:07 +02:00
amyeroberts
e3f028f3af
Add TF whisper ( #19378 )
...
* simplify loop
* add featur extractor
* add model
* start conversion
* add dropout
* initial commit of test files
* copnversion for all models
* update processor for correct padding
* update feature extraction
* update integration test logits match
* fmnt: off for the logits
* on the fly mel bank
* small nit
* update test
* update tokenizer
* nit feature extraction
* update
* update tokenizer test
* adds logit processor and update tokenizer to get supress tokens
* style
* clean convert
* revert to original modeling tf utils
* Update
* update
* nit
* clean convert file
* update tests and nits
* quality
* slow generation test
* ffn_dim to allow customization
* update readme
* add to toctreee
* start fixing integration tests
* update tests and code
* fix feature extractor
* fix config tests common
* update code to fix tests
* fix feature exctractor
* nit feature extraction
* update test for new feature extractor
* style
* add absrtact
* large logits wioth custom decoder input ids
* wraap around is otrch available
* fix feature extractor
* correct logits for whisper small.en
* nit
* fix encoder_attentino_mask
* some fixes
* remove unnecessary inputs
* nits
* add normalizer file
* update etst tokenization
* fix attention mask not defined
* fix generate
* remove uncoder attention mask useless
* update test modeling whisper
* update condfig to add second non supress tokens
* nits on feature exrtactor
* nit for test tokenizers
* update etsts
* update tests
* update tokenization test
* fixup
* invalidated hf token. Clean convert openai to whisper
* fix logit tests
* fixup
* Add model to README
* Fix doc tests
* clean merge
* revert toc_tree changes
* remove useless LogitProcessor
* Update whisper .mdx
* update config file doc
* update configuration docstring
* update test tokenization
* update test tokenization
* update tokenization whisper
Added copied from where needed
* update feature extraction
* nit test name
* style
* quality
* remove get suppress tokens and update non_speech tokens global variables
* Update src/transformers/models/whisper/feature_extraction_whisper.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* clean modeling whisper and test
Removed the attention mask arguments that are deprecated
* fix large test
* Add multilingual audio test, and translate test
* style
* fix larg multilingual test
* nits
* add copied from for attention layer
* remove attention masks in doc
* add english normalizer
* Update docs/source/en/model_doc/whisper.mdx
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* update tokenization test
* remove copied from in whisper attention : no bias in k_proj only
* wrap around dependencies in english normalizer
* style
* correct import generation logits
* for now, wrap feature extractor with torch
* remove torch depencies for feature extraction and style
* Update src/transformers/models/whisper/convert_openai_whisper_to_tfms.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update docs/source/en/model_doc/whisper.mdx
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* fixup
* nit
* update logitds
* style
* nit
* nits and fix final tests
* add `is_more_itertools_available` to utils
* quality
* add begin supress tokens, supress tokens to generate args and config
* clean supressTokensLogitProcessor in generation logits
* Nit naming
* add supressTokensAtBegin
* udpate tests, supress tokens to None or correct values
* nit and style
* update RAG to fit test and generate_logit
* add copy pasted statment on english normalizer
* add arguments to config_common_kwargs
* Update src/transformers/generation_utils.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update src/transformers/generation_logits_process.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* revert changes based on reviews
* update doc and nits
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* more nits
* last nits
* update test configuration common
* add BART name in decoder attention mask documentation
* Update src/transformers/models/whisper/modeling_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* style
* nit
* nit
* add english.json file to git
* nits on documentation
* nit
* nits
* last styling
* add main toctree file
* remove sentence piece dependency
* clean init file
* fix tokenizer that has no dependencies on sentencepiece
* update whisper init file, nit
* remove english.json file
* add get decoder prompt id
* All weights loading
* Remove hanging pdb
* Fixup and tidy up
* Use same copied from as PT model
* Remove whitespace changes
* Remove torch references
* Tie embeddings
* Remove logits processor input to generate
* Update logit values
* revert changes and add forced logit processor
* nit
* clean normalizer
* remove protected
* Add logit processors and update generation code & tests
* Some tidy up
* Update docstring
* update
* update based on review
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update to reflect changes on the PT model branch
* Tidy up
* Remove extra whitespace
* Fix test - make input ids small enough we can append
* Include upstream changes on main
* PR comments - add batch tests, remove comments & defaults
* Fix model output imports
* Update src/transformers/models/whisper/modeling_tf_whisper.py
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
* Update src/transformers/generation_tf_logits_process.py
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
* Update src/transformers/models/whisper/modeling_tf_whisper.py
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
* Update src/transformers/models/whisper/modeling_tf_whisper.py
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
* Update tests/models/whisper/test_modeling_tf_whisper.py
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
* Update src/transformers/models/whisper/modeling_tf_whisper.py
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
* Update src/transformers/models/whisper/modeling_tf_whisper.py
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
* Update docstring example
* Update src/transformers/models/whisper/modeling_tf_whisper.py
Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>
* Remove changes to adjust_logits_during_generation function
* Update src/transformers/models/whisper/modeling_tf_whisper.py
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
* Tidy up imports that don't require TF
* Update tests - skip and no more skip
* Update tests/generation/test_generation_tf_logits_process.py
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
* Update src/transformers/models/whisper/modeling_tf_whisper.py
* Update src/transformers/models/whisper/modeling_tf_whisper.py
Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>
* Add training flags
* Add (skipped) XLA generation tests
* Add embedding correctness test
* Add constant ids for generation tests
* Make logits finding a bit tidier
* Remove unused args
* xla generation enabled
* Don't skip XLA tests anymore
* Fix tests - add position ids to expected signature and update rag generation
* Undo method reorder
* Remove added whitespace
* Remove copy-paste gradient checkopint ref
* Remove
* Trigger CI - (issue with refs when pulling)
Co-authored-by: Arthur Zucker <arthur.zucker@gmail.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: NielsRogge <niels.rogge1@gmail.com>
Co-authored-by: Arthur <48595927+ArthurZucker@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: Joao Gante <joaofranciscocardosogante@gmail.com>
Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>
Co-authored-by: Joao Gante <joao@huggingface.co>
2022-10-10 14:48:17 +01:00
Arthur
45e14038f2
Add WhisperModel to transformers ( #19166 )
...
* simplify loop
* add featur extractor
* add model
* start conversion
* add dropout
* initial commit of test files
* copnversion for all models
* update processor for correct padding
* update feature extraction
* update integration test logits match
* fmnt: off for the logits
* on the fly mel bank
* small nit
* update test
* update tokenizer
* nit feature extraction
* update
* update tokenizer test
* adds logit processor and update tokenizer to get supress tokens
* style
* clean convert
* revert to original modeling tf utils
* Update
* update
* nit
* clean convert file
* update tests and nits
* quality
* slow generation test
* ffn_dim to allow customization
* update readme
* add to toctreee
* start fixing integration tests
* update tests and code
* fix feature extractor
* fix config tests common
* update code to fix tests
* fix feature exctractor
* nit feature extraction
* update test for new feature extractor
* style
* add absrtact
* large logits wioth custom decoder input ids
* wraap around is otrch available
* fix feature extractor
* correct logits for whisper small.en
* nit
* fix encoder_attentino_mask
* some fixes
* remove unnecessary inputs
* nits
* add normalizer file
* update etst tokenization
* fix attention mask not defined
* Add model to README
* Fix doc tests
* fix generate
* remove uncoder attention mask useless
* update test modeling whisper
* update condfig to add second non supress tokens
* nits on feature exrtactor
* nit for test tokenizers
* update etsts
* update tests
* update tokenization test
* fixup
* invalidated hf token. Clean convert openai to whisper
* fix logit tests
* fixup
* clean merge
* revert toc_tree changes
* remove useless LogitProcessor
* Update whisper .mdx
* update config file doc
* update configuration docstring
* update test tokenization
* update test tokenization
* update tokenization whisper
Added copied from where needed
* update feature extraction
* nit test name
* style
* quality
* remove get suppress tokens and update non_speech tokens global variables
* Update src/transformers/models/whisper/feature_extraction_whisper.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* clean modeling whisper and test
Removed the attention mask arguments that are deprecated
* fix large test
* Add multilingual audio test, and translate test
* style
* fix larg multilingual test
* nits
* Update docs/source/en/model_doc/whisper.mdx
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* add copied from for attention layer
* remove attention masks in doc
* add english normalizer
* update tokenization test
* remove copied from in whisper attention : no bias in k_proj only
* wrap around dependencies in english normalizer
* style
* correct import generation logits
* for now, wrap feature extractor with torch
* Update src/transformers/models/whisper/convert_openai_whisper_to_tfms.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update docs/source/en/model_doc/whisper.mdx
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* remove torch depencies for feature extraction and style
* fixup
* nit
* update logitds
* style
* nit
* nits and fix final tests
* add `is_more_itertools_available` to utils
* quality
* add begin supress tokens, supress tokens to generate args and config
* clean supressTokensLogitProcessor in generation logits
* Nit naming
* add supressTokensAtBegin
* udpate tests, supress tokens to None or correct values
* nit and style
* update RAG to fit test and generate_logit
* add copy pasted statment on english normalizer
* add arguments to config_common_kwargs
* Update src/transformers/generation_utils.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update src/transformers/generation_logits_process.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* revert changes based on reviews
* update doc and nits
* more nits
* last nits
* update test configuration common
* add BART name in decoder attention mask documentation
* Update src/transformers/models/whisper/modeling_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* style
* nit
* nit
* add english.json file to git
* nits on documentation
* nit
* nits
* last styling
* add main toctree file
* remove sentence piece dependency
* clean init file
* fix tokenizer that has no dependencies on sentencepiece
* update whisper init file, nit
* remove english.json file
* add get decoder prompt id
* revert changes and add forced logit processor
* nit
* clean normalizer
* remove protected
* update
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* update based on review
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* add batched tests
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: NielsRogge <niels.rogge1@gmail.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-05 22:28:31 +02:00
NielsRogge
f3d2f7a6e0
Add MarkupLM ( #19198 )
...
* First draft
* Make basic test work
* Fix most tokenizer tests
* More improvements
* Make more tests pass
* Fix more tests
* Fix some code quality
* Improve truncation
* Implement feature extractor
* Improve feature extractor and add tests
* Improve feature extractor tests
* Fix pair_input test partly
* Add fast tokenizer
* Improve implementation
* Fix rebase
* Fix rebase
* Fix most of the tokenizer tests.
* propose solution for fast
* add: integration test for fasttokenizer, warning for decode, fix template in slow tokenizer
* add: modify markuplmconverter
* add: some modify on converter and tokenizerfast
* Fix style, copies
* Make fixup
* Update tokenization_markuplm.py
* Update test_tokenization_markuplm.py
* Update markuplm related
* Improve processor, add integration test
* Add processor test file
* Improve processor
* Improve processor tests
* Fix more processor tests
* Fix processor tests
* Update docstrings
* Add Copied from statements
* Add more Copied from statements
* Add code examples
* Improve code examples
* Add model to doc tests
* Adding dependency check
* Add dummy file
* Add requires_backends
* Add model to toctree
* Fix more things, disable dependency check for now
* Apply more suggestions
* Add soft dependency
* Add annotators to tests
* Fix style
* Remove from_slow=True
* Remove print statements
* Add sanity check
* Fix processor test
* Fix processor tests, add more docs
* Add doc tests for mdx file
* Add more tips
* Apply suggestions
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
Co-authored-by: lockon-n <45759388+lockon-n@users.noreply.github.com>
Co-authored-by: SaulLu <lucilesaul.com@gmail.com>
Co-authored-by: lockon-n <dd098309@126.com>
2022-09-30 08:25:43 +02:00
Aritra Roy Gosthipaty
0dc7b3a785
[TensorFlow] Adding GroupViT ( #18020 )
...
* 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: ydshieh <ydshieh@users.noreply.github.com>
2022-09-29 10:48:04 +01:00
Steven Anton
49bf569830
Add doctests to Perceiver examples ( #19129 )
...
* Fix bug in example and add to tests
* Fix failing tests
* Check the size of logits
* Code style
* Try again...
* Add expected loss for PerceiverForMaskedLM doctest
Co-authored-by: Steven Anton <antonstv@amazon.com>
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-23 19:19:35 +02:00
NielsRogge
cf6308ef9b
Improve conditional detr docs ( #19154 )
...
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-09-22 13:21:05 +02:00
Sayak Paul
2d9853b226
MSN (Masked Siamese Networks) for ViT ( #18815 )
...
* feat: modeling and conversion scripts for msn.
* chore: change license year.
* chore: remove unneeded modules.
* feat: direct loading of state_dict from remote url.
* fix: import paths.
* add: rest of the files.
* add and fix rest of the files.
Co-authored-by: Niels <niels.rogge1@gmail.com>
* chore: formatting.
* code quality fix.
* chore: remove pooler.
* feat: add classification top.
* fix: configuration object.
* add: initial test cases (one failing).
* fix: basemodeloutput.
* add: caution on using the classification head.
* add: rest of the model related files.
* add: vit msn readme.
* fix: copied from statement.
* fix: dummy objects.
* add: ViTMSNPreTrainedModel to inits.
* fix: repo consistency.
* minor change in the model doc.
* fix: tests.
* Empty-Commit
* Update src/transformers/models/vit_msn/configuration_vit_msn.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* address PR comments.
* Update src/transformers/models/vit_msn/modeling_vit_msn.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* chore: put model in no_grad() and formatting.
Co-authored-by: Niels <niels.rogge1@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
2022-09-22 07:15:03 -04:00
NielsRogge
59407bbeb3
Add Deformable DETR ( #17281 )
...
* 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: Nicolas Patry <patry.nicolas@protonmail.com>
Co-authored-by: Nouamane Tazi <nouamane98@gmail.com>
Co-authored-by: Sylvain Gugger <Sylvain.gugger@gmail.com>
2022-09-14 11:45:21 +02:00
Sayak Paul
954e18ab97
TensorFlow MobileViT ( #18555 )
...
* initial implementation.
* add: working model till image classification.
* add: initial implementation that passes intg tests.
Co-authored-by: Amy <aeroberts4444@gmail.com>
* chore: formatting.
* add: tests (still breaking because of config mismatch).
Coo-authored-by: Yih <2521628+ydshieh@users.noreply.github.com>
* add: corrected tests and remaning changes.
* fix code style and repo consistency.
* address PR comments.
* address Amy's comments.
* chore: remove from_pt argument.
* chore: add full-stop.
* fix: TFLite model conversion in the doc.
* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* apply formatting.
* chore: remove comments from the example block.
* remove identation in the example.
Co-authored-by: Amy <aeroberts4444@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-09-01 10:35:15 -04:00
Ankur Goyal
5c4c869014
Add LayoutLMForQuestionAnswering model ( #18407 )
...
* 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: Ankur Goyal <ankur@impira.com>
2022-08-31 10:05:33 +02:00
Dan Tegzes
5727dfcebe
Added Docstrings for Deberta and DebertaV2 [PyTorch] ( #18610 )
...
* Added Doctest for Deberta Pytorch
* Added path in documentation test file
* Added docstrings for DebertaV2
* Revert "Added docstrings for DebertaV2"
This reverts commit 307185e62a
.
* Added DebertaV2 Docstrings
2022-08-30 14:46:21 +02:00
Christoffer Koo Øhrstrøm
de8548ebf3
[LayoutLMv3] Add TensorFlow implementation ( #18678 )
...
Co-authored-by: Esben Toke Christensen <esben.christensen@visma.com>
Co-authored-by: Lasse Reedtz <lasse.reedtz@visma.com>
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
2022-08-30 11:48:11 +01:00
NielsRogge
2ab790e82d
Add Donut ( #18488 )
...
* 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: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-08-12 16:40:58 +02:00
NielsRogge
82bb682643
[VideoMAE] Add model to doc tests ( #18523 )
...
* Add videomae to doc tests
* Add pip install decord
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-08-08 19:28:51 +02:00
Yih-Dar
b53dab601c
Remove Flax OPT from doctest for now ( #18338 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-28 11:50:44 -04:00
Alara Dirik
002915aa2a
Owlvit docs test ( #18257 )
...
* fix docs and add owlvit docs test
* fix minor bug in post_process, add to processor
* improve owlvit code examples
* fix hardcoded image size
2022-07-26 10:55:14 +03:00
Sayak Paul
561b9a8c00
[SegFormer] TensorFlow port ( #17910 )
...
* 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: matt <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: Joao 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: matt <rocketknight1@gmail.com>
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
2022-07-21 18:22:37 +01:00