transformers/utils
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
..
test_module AutoImageProcessor (#20111) 2022-11-08 19:54:41 +00:00
tf_ops Check TF ops for ONNX compliance (#10025) 2021-02-15 07:55:10 -05:00
check_config_attributes.py refactor: Make direct_transformers_import util (#21652) 2023-02-16 11:32:32 -05:00
check_config_docstrings.py refactor: Make direct_transformers_import util (#21652) 2023-02-16 11:32:32 -05:00
check_copies.py refactor: Make direct_transformers_import util (#21652) 2023-02-16 11:32:32 -05:00
check_doc_toc.py Split model list on modality (#18328) 2022-08-01 11:10:20 -05:00
check_doctest_list.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
check_dummies.py Cleanup quality (#21493) 2023-02-07 12:27:31 -05:00
check_inits.py refactor: Make direct_transformers_import util (#21652) 2023-02-16 11:32:32 -05:00
check_repo.py add flax whisper implementation (#20479) 2023-02-20 09:17:40 +01:00
check_self_hosted_runner.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
check_table.py refactor: Make direct_transformers_import util (#21652) 2023-02-16 11:32:32 -05:00
check_task_guides.py refactor: Make direct_transformers_import util (#21652) 2023-02-16 11:32:32 -05:00
check_tf_ops.py Check TF ops for ONNX compliance (#10025) 2021-02-15 07:55:10 -05:00
create_dummy_models.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
custom_init_isort.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
documentation_tests.txt [CLAP] Add CLAP to the library (#21370) 2023-02-16 20:59:27 +01:00
download_glue_data.py Raise exceptions instead of asserts (#13907) 2021-10-07 12:44:23 +05:30
extract_warnings.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
get_ci_error_statistics.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
get_github_job_time.py add a script to get time info. from GA workflow jobs (#18822) 2022-09-01 12:02:52 +02:00
get_modified_files.py exclude deleted files in the fixup script (#21436) 2023-02-03 12:57:02 -05:00
notification_service_doc_tests.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
notification_service.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
past_ci_versions.py Fix past CI (#20967) 2023-01-12 18:04:21 +01:00
prepare_for_doc_test.py Add a check regarding the number of occurrences of ``` (#18389) 2022-08-01 14:23:02 +02:00
print_env.py Print more library versions in CI (#17384) 2022-06-02 10:24:16 +02:00
release.py Clean README in post release job as well. (#17519) 2022-06-02 07:44:03 -04:00
sort_auto_mappings.py Automatically sort auto mappings (#17250) 2022-05-16 13:24:20 -04:00
tests_fetcher.py Add TF image classification example script (#19956) 2023-02-01 19:09:36 +00:00
update_metadata.py refactor: Make direct_transformers_import util (#21652) 2023-02-16 11:32:32 -05:00