transformers/tests/models
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
..
albert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
auto Make AutoProcessor a magic loading class for all modalities (#18963) 2022-09-14 07:36:12 -04:00
bart TF: TF 2.10 unpin + related onnx test skips (#18995) 2022-09-12 19:30:27 +01:00
barthez Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
bartpho Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
beit Fix BeitFeatureExtractor postprocessing (#19119) 2022-09-20 18:53:40 +03:00
bert TF: TF 2.10 unpin + related onnx test skips (#18995) 2022-09-12 19:30:27 +01:00
bert_generation Black preview (#17217) 2022-05-12 16:25:55 -04:00
bert_japanese Add sudachi and jumanpp tokenizers for bert_japanese (#19043) 2022-10-05 11:41:37 -04:00
bertweet Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
big_bird wrap forward passes with torch.no_grad() (#19273) 2022-10-04 16:13:22 +02:00
bigbird_pegasus Black preview (#17217) 2022-05-12 16:25:55 -04:00
blenderbot Update serving code to enable saved_model=True (#18153) 2022-07-22 18:05:38 +01:00
blenderbot_small Update serving code to enable saved_model=True (#18153) 2022-07-22 18:05:38 +01:00
bloom Skip BloomEmbeddingTest.test_embeddings for PyTorch < 1.10 (#19261) 2022-10-10 10:05:30 +02:00
bort Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
byt5 Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
camembert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
canine Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
clip Update serving code to enable saved_model=True (#18153) 2022-07-22 18:05:38 +01:00
codegen Update expected values in CodeGen tests (#17888) 2022-07-01 15:33:36 +02:00
conditional_detr Add support for conditional detr (#18948) 2022-09-22 09:45:04 +02:00
convbert wrap forward passes with torch.no_grad() (#19274) 2022-10-04 16:12:03 +02:00
convnext FX support for ConvNext, Wav2Vec2 and ResNet (#19053) 2022-09-16 10:57:41 +02:00
cpm Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
ctrl Fix CTRL tests (#17508) 2022-06-01 16:27:23 +02:00
cvt has_attentions - consistent test skipping logic and tf tests (#17495) 2022-06-09 09:50:03 +02:00
data2vec skip some test_multi_gpu_data_parallel_forward (#18188) 2022-07-20 15:54:44 +02:00
deberta fix train_new_from_iterator in the case of byte-level tokenizers (#17549) 2022-06-08 15:30:41 +02:00
deberta_v2 wrap forward passes with torch.no_grad() (#19278) 2022-10-04 16:09:23 +02:00
decision_transformer Update expected values in DecisionTransformerModelIntegrationTest (#18016) 2022-07-05 14:53:43 +02:00
deformable_detr [fix] Add DeformableDetrFeatureExtractor (#19140) 2022-09-22 09:45:24 +02:00
deit wrap forward passes with torch.no_grad() (#19279) 2022-10-04 16:08:29 +02:00
detr [fix] Add DeformableDetrFeatureExtractor (#19140) 2022-09-22 09:45:24 +02:00
distilbert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
dit Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
donut remvoe _create_and_check_torch_fx_tracing in specific test files (#18667) 2022-09-07 16:22:09 +02:00
dpr Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
dpt Add post_process_semantic_segmentation method to DPTFeatureExtractor (#19107) 2022-09-21 15:15:26 +03:00
electra Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
encoder_decoder Fix Encoder-Decoder testing issue about repo. names (#19250) 2022-09-30 18:15:07 +02:00
ernie add task_type_id to BERT to support ERNIE-2.0 and ERNIE-3.0 models (#18686) 2022-09-09 07:36:46 -04:00
esm Fix repo names for ESM tests (#19451) 2022-10-10 13:20:00 +01:00
flaubert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
flava has_attentions - consistent test skipping logic and tf tests (#17495) 2022-06-09 09:50:03 +02:00
fnet Black preview (#17217) 2022-05-12 16:25:55 -04:00
fsmt Not use -1e4 as attn mask (#17306) 2022-06-20 16:16:16 +02:00
funnel Update serving code to enable saved_model=True (#18153) 2022-07-22 18:05:38 +01:00
glpn Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
gpt_neo fix train_new_from_iterator in the case of byte-level tokenizers (#17549) 2022-06-08 15:30:41 +02:00
gpt_neox skip some gpt_neox tests that require 80G RAM (#17923) 2022-07-01 09:04:38 -04:00
gpt_neox_japanese Add support for Japanese GPT-NeoX-based model by ABEJA, Inc. (#18814) 2022-09-14 10:17:40 -04:00
gpt2 Fixing OPT fast tokenizer option. (#18753) 2022-09-15 17:12:58 +02:00
gptj TF: GPT-J compatible with XLA generation (#17986) 2022-07-06 15:02:07 +01:00
groupvit [TensorFlow] Adding GroupViT (#18020) 2022-09-29 10:48:04 +01:00
herbert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
hubert Fix train_step, test_step and tests for CLIP (#18684) 2022-09-09 20:01:02 +01:00
ibert fix train_new_from_iterator in the case of byte-level tokenizers (#17549) 2022-06-08 15:30:41 +02:00
imagegpt Enabling imageGPT auto feature extractor. (#16871) 2022-05-24 12:30:46 +02:00
layoutlm TF: TF 2.10 unpin + related onnx test skips (#18995) 2022-09-12 19:30:27 +01:00
layoutlmv2 add warning to let the user know that the __call__ method is faster than encode + pad for a fast tokenizer (#18693) 2022-08-24 06:27:56 -04:00
layoutlmv3 Fix test_tf_encode_plus_sent_to_model for LayoutLMv3 (#18898) 2022-09-06 14:51:03 +02:00
layoutxlm LayoutXLMProcessor: ensure 1-to-1 mapping between samples and images, and add test for it (#18774) 2022-08-30 14:43:14 +02:00
led Fix tflongformer int dtype (#18907) 2022-09-12 17:51:10 +01:00
levit Add skip logic for attentions test - Levit (#17633) 2022-06-10 12:46:30 +02:00
longformer Fix tflongformer int dtype (#18907) 2022-09-12 17:51:10 +01:00
longt5 Skip test_export_to_onnx for LongT5 if torch < 1.11 (#19122) 2022-09-20 21:52:18 +02:00
luke Adding fine-tuning models to LUKE (#18353) 2022-08-01 11:09:47 -04:00
lxmert Update serving code to enable saved_model=True (#18153) 2022-07-22 18:05:38 +01:00
m2m_100 Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
marian Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
markuplm Add MarkupLM (#19198) 2022-09-30 08:25:43 +02:00
maskformer Fix MaskFormer failing postprocess tests (#19354) 2022-10-05 23:25:58 +03:00
mbart Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
mbart50 Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
mctct Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
megatron_bert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
megatron_gpt2 Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
mluke Black preview (#17217) 2022-05-12 16:25:55 -04:00
mobilebert Fix train_step, test_step and tests for CLIP (#18684) 2022-09-09 20:01:02 +01:00
mobilevit Add semantic segmentation post-processing method to MobileViT (#19105) 2022-09-23 16:24:28 +03:00
mpnet Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
mt5 Fix expected loss values in some (m)T5 tests (#18177) 2022-07-18 15:26:21 +02:00
mvp Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
nezha speed up test (#18106) 2022-07-12 04:28:28 -04:00
nllb Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
nystromformer Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
openai Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
opt Add OPTForQuestionAnswering (#19402) 2022-10-10 09:30:59 -04:00
owlvit fix owlvit tests, update docstring examples (#18586) 2022-08-11 19:10:25 +03:00
pegasus Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
pegasus_x Fix CI for PegasusX (#19025) 2022-09-14 14:45:00 +02:00
perceiver Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
phobert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
plbart Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
poolformer has_attentions - consistent test skipping logic and tf tests (#17495) 2022-06-09 09:50:03 +02:00
prophetnet Black preview (#17217) 2022-05-12 16:25:55 -04:00
qdqbert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
rag Avoid GPU OOM for a TF Rag test (#17638) 2022-06-10 18:50:29 +02:00
realm Black preview (#17217) 2022-05-12 16:25:55 -04:00
reformer Black preview (#17217) 2022-05-12 16:25:55 -04:00
regnet Run tests if skip condition not met (#18764) 2022-08-30 14:03:28 +02:00
rembert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
resnet FX support for ConvNext, Wav2Vec2 and ResNet (#19053) 2022-09-16 10:57:41 +02:00
retribert fix retribert's test_torch_encode_plus_sent_to_model (#17231) 2022-05-17 14:33:13 +02:00
roberta fix train_new_from_iterator in the case of byte-level tokenizers (#17549) 2022-06-08 15:30:41 +02:00
roformer Skip RoFormer ONNX test if rjieba not installed (#16981) 2022-05-04 10:04:10 +02:00
segformer Add post_process_semantic_segmentation method to SegFormer (#19072) 2022-09-21 11:40:35 +03:00
sew Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
sew_d Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
speech_encoder_decoder send model to the correct device (#18800) 2022-08-29 18:46:30 +02:00
speech_to_text remvoe _create_and_check_torch_fx_tracing in specific test files (#18667) 2022-09-07 16:22:09 +02:00
speech_to_text_2 Fx support for multiple model architectures (#17393) 2022-05-31 10:02:55 +02:00
splinter Fix Splinter test (#17854) 2022-06-24 16:26:14 +02:00
squeezebert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
swin remvoe _create_and_check_torch_fx_tracing in specific test files (#18667) 2022-09-07 16:22:09 +02:00
swinv2 Add swin transformer v2 (#17469) 2022-07-27 11:14:47 -04:00
t5 Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
tapas Fix train_step, test_step and tests for CLIP (#18684) 2022-09-09 20:01:02 +01:00
tapex Replace as_target context managers by direct calls (#18325) 2022-07-29 08:09:09 -04:00
time_series_transformer time series forecasting model (#17965) 2022-09-30 15:32:59 -04:00
trajectory_transformer Add trajectory transformer (#17141) 2022-05-17 19:07:43 -04:00
transfo_xl Add magic method to our TF models to convert datasets with column inference (#17160) 2022-06-06 15:53:49 +01:00
trocr Fx support for multiple model architectures (#17393) 2022-05-31 10:02:55 +02:00
unispeech Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
unispeech_sat Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
van has_attentions - consistent test skipping logic and tf tests (#17495) 2022-06-09 09:50:03 +02:00
videomae Use repo_type instead of deprecated datasets repo IDs (#19202) 2022-09-26 09:50:48 -04:00
vilt Add accelerate support for ViLT (#18683) 2022-09-22 13:14:39 +02:00
vision_encoder_decoder Fix Encoder-Decoder testing issue about repo. names (#19250) 2022-09-30 18:15:07 +02:00
vision_text_dual_encoder Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
visual_bert Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
vit Improve vision models (#17731) 2022-06-24 11:34:51 +02:00
vit_mae TF: tests for (de)serializable models with resized tokens (#19013) 2022-09-16 16:38:08 +01:00
vit_msn fix: ckpt paths. (#19159) 2022-09-22 11:03:01 -04:00
wav2vec2 FX support for ConvNext, Wav2Vec2 and ResNet (#19053) 2022-09-16 10:57:41 +02:00
wav2vec2_conformer [Test] Fix W2V-Conformer integration test (#17303) 2022-05-17 18:20:36 +02:00
wav2vec2_phoneme Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
wav2vec2_with_lm [Wav2vec2 + LM Test] Improve wav2vec2 with lm tests and make torch version dependent for now (#18749) 2022-08-26 14:11:55 +02:00
wavlm Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
whisper Add TF whisper (#19378) 2022-10-10 14:48:17 +01:00
x_clip Use repo_type instead of deprecated datasets repo IDs (#19202) 2022-09-26 09:50:48 -04:00
xglm XGLM - Fix Softmax NaNs when using FP16 (#18057) 2022-09-29 10:42:07 +02:00
xlm Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
xlm_prophetnet Black preview (#17217) 2022-05-12 16:25:55 -04:00
xlm_roberta Black preview (#17217) 2022-05-12 16:25:55 -04:00
xlm_roberta_xl Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
xlnet Return scalar losses instead of per-sample means (#18013) 2022-07-04 17:26:19 +01:00
yolos [fix] Add DeformableDetrFeatureExtractor (#19140) 2022-09-22 09:45:24 +02:00
yoso fix train_new_from_iterator in the case of byte-level tokenizers (#17549) 2022-06-08 15:30:41 +02:00
__init__.py Move test model folders (#17034) 2022-05-03 14:42:02 +02:00