transformers/tests
Andy Ehrenberg 2840272c5f
add flax whisper implementation (#20479)
* add flax whisper implementation

* rever change to setup

* remove unused imports

* revert generation changes

* flax whisper docs

* docs

* import order

* import sorting

* isort

* add dummy objects

* doc formatting

* formatting

* remove trailing whitespaces

* fix flax whisper docs

* add generation logic to unlock flax whisper

* remove scans

* give credits to Flax Bart implementation

* remove unused imports

* add license

* remove assert

* more credits to Bart

* fix style

* formatting

* support left padding

* add flax whisper generation test

* remove copied from comments whenever not a full copy

* fix docstrings for logits processors

* revert change to FlaxForceTokensLogitsProcessor

* revert doc changes

* improve generation docs

* reorganize

* formatting

* cleanup docs

* add tests

* handle empty list case

* fix forced decoder ids in flax tests

* add flax whisper to inits

* upate dummy objects

* docs for FlaxAutoModelForSpeechSeq2Seq

* fix decoder_position_ids computation in pretrained model decode/__call__ fns

* add Copied from statements as necessary

* compute position_ids only in __call__ and decode methods of pretrained model subclasses

* improve readabilityof compute positional embeddings

* check dimensionality of input_features instead of hidden_states

* copied from statement for init_cache

* formatting

* fix copies

* fix copies

* pass attention mask to encoder layers

* fix decoder module outputs

* set dtype

Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>

* smaller flax model for whisper test

* Update src/transformers/generation/flax_utils.py

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

* Update src/transformers/models/whisper/modeling_flax_whisper.py

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

* Update tests/models/whisper/test_modeling_flax_whisper.py

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

* cleanup

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

* Update src/transformers/models/whisper/modeling_flax_whisper.py

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

* bias cleanup

* doc fix

* align style for force tokens processor

* readability

* fix input shape in tests

* revert FlaxGenerationMixin docstring

* formatting

* fix tests

* fix imports

* consistent encoder hidden states

* consistent hidden states

* input shapes

* typo

* partial class trick

* partial class for input shape

* base_class with correct input shape

* partial base classes

* match by name

* set main_input_name

* compare on names

* formatting

* remove unused import

* safer position ids computation

* safer position id computation

* Update src/transformers/models/whisper/modeling_flax_whisper.py

Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>

* Update src/transformers/models/whisper/modeling_flax_whisper.py

Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>

* remove identical inherited tests

* fix prompt ids in tests

* use generation config

* use jnp array

* better var names

* more explicit bias use

* import transformers

* formatting

* test formatting

* remove unused imports

* remove unused imports

* formatting

* isort

* docs

* fix ln orders for encoder hidden states

* whisper unique generation stuff

* flake

* use finfo for attention bias

* docs

* Update src/transformers/generation/flax_utils.py

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* docs

* add timestamp flax test

* jit for timestamps

* formatting

* clean up timestamps processor

* formatting

* remove if_true

* cleanup

---------

Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
2023-02-20 09:17:40 +01:00
..
benchmark [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
deepspeed [tests] add missing report_to none (#21505) 2023-02-08 09:32:40 -08:00
extended Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
fixtures [WIP] add SpeechT5 model (#18922) 2023-02-03 12:43:46 -05:00
generation Generate: filter encoder inputs when its signature does not accept wildcards (#21603) 2023-02-14 10:46:46 +00:00
mixed_int8 [bnb] Introducing BitsAndBytesConfig (#21579) 2023-02-17 09:44:01 +01:00
models add flax whisper implementation (#20479) 2023-02-20 09:17:40 +01:00
onnx Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
optimization Add inverse sqrt learning rate scheduler (#21495) 2023-02-07 15:00:50 -05:00
pipelines refactor: Make direct_transformers_import util (#21652) 2023-02-16 11:32:32 -05:00
repo_utils Cleanup quality (#21493) 2023-02-07 12:27:31 -05:00
sagemaker Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
tokenization Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
trainer Fix epoch number when resuming training (#21478) 2023-02-06 19:34:34 -05:00
utils Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
__init__.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_configuration_common.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
test_feature_extraction_common.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
test_image_processing_common.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
test_image_transforms.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
test_modeling_common.py Fix generation config for empty state dict (#21630) 2023-02-14 10:57:28 -05:00
test_modeling_flax_common.py [Tests] Improve flax test_attention_outputs (#21486) 2023-02-10 11:31:49 -05:00
test_modeling_tf_common.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
test_sequence_feature_extraction_common.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
test_tokenization_common.py Cleanup quality (#21493) 2023-02-07 12:27:31 -05:00