transformers/tests/utils
Yoach Lacombe c43b380e70
Add MusicGen Melody (#28819)
* first modeling code

* make repository

* still WIP

* update model

* add tests

* add latest change

* clean docstrings and copied from

* update docstrings md and readme

* correct chroma function

* correct copied from and remove unreleated test

* add doc to toctree

* correct imports

* add convert script to notdoctested

* Add suggestion from Sanchit

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

* correct get_uncoditional_inputs docstrings

* modify README according to SANCHIT feedback

* add chroma to audio utils

* clean librosa and torchaudio hard dependencies

* fix FE

* refactor audio decoder -> audio encoder for consistency with previous musicgen

* refactor conditional -> encoder

* modify sampling rate logics

* modify license at the beginning

* refactor all_self_attns->all_attentions

* remove ignore copy from causallm generate

* add copied from for from_sub_models

* fix make copies

* add warning if audio is truncated

* add copied from where relevant

* remove artefact

* fix convert script

* fix torchaudio and FE

* modify chroma method according to feedback-> better naming

* refactor input_values->input_features

* refactor input_values->input_features and fix import fe

* add input_features to docstrigs

* correct inputs_embeds logics

* remove dtype conversion

* refactor _prepare_conditional_hidden_states_kwargs_for_generation ->_prepare_encoder_hidden_states_kwargs_for_generation

* change warning for chroma length

* Update src/transformers/models/musicgen_melody/convert_musicgen_melody_transformers.py

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

* change way to save wav, using soundfile

* correct docs and change to soundfile

* fix import

* fix init proj layers

* remove line breaks from md

* fix issue with docstrings

* add FE suggestions

* improve is in logics and remove useless imports

* remove custom from_pretrained

* simplify docstring code

* add suggestions for modeling tests

* make style

* update converting script with sanity check

* remove encoder attention mask from conditional generation

* replace musicgen melody checkpoints with official orga

* rename ylacombe->facebook in checkpoints

* fix copies

* remove unecessary warning

* add shape in code docstrings

* add files to slow doc tests

* fix md bug and add md to not_tested

* make fix-copies

* fix hidden states test and batching

---------

Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>
2024-03-18 13:06:12 +00:00
..
__init__.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_activations.py Add the GeLU activation from pytorch with the tanh approximation (#21345) 2023-02-02 09:33:04 -05:00
test_activations_tf.py TF: Add sigmoid activation function (#16819) 2022-04-19 16:13:08 +01:00
test_add_new_model_like.py Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
test_audio_utils.py Add MusicGen Melody (#28819) 2024-03-18 13:06:12 +00:00
test_backbone_utils.py Backbone kwargs in config (#28784) 2024-02-14 20:46:44 +00:00
test_cli.py Safetensors serialization by default (#27064) 2023-10-31 19:16:49 +01:00
test_convert_slow_tokenizer.py Revert error back into warning for byte fallback conversion. (#22607) 2023-04-06 14:00:29 +02:00
test_doc_samples.py Fix the check of models supporting FA/SDPA not run (#28202) 2023-12-22 12:56:11 +01:00
test_dynamic_module_utils.py Fix the regex in `get_imports` to support multiline try blocks and excepts with specific exception types (#23725) 2023-05-24 15:40:19 -04:00
test_file_utils.py Inheritance-based framework detection (#21784) 2023-02-27 15:31:55 +00:00
test_generic.py Refactor conversion function (#19799) 2022-10-24 13:48:40 -04:00
test_hf_argparser.py ⚠️ Time to say goodbye to py37 (#24091) 2023-06-28 07:22:39 +02:00
test_hub_utils.py Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
test_image_processing_utils.py Add Image Processors (#19796) 2022-11-02 11:57:36 +00:00
test_image_utils.py Update fixtures-image-utils (#28080) 2023-12-15 16:58:36 +00:00
test_logging.py Fix flaky test for log level (#21776) 2023-02-28 16:24:14 -05:00
test_model_card.py Black preview (#17217) 2022-05-12 16:25:55 -04:00
test_model_output.py fix / skip (for now) some tests before switch to torch 2.2 (#28838) 2024-02-02 14:11:50 +01:00
test_modeling_tf_core.py Add tf_keras imports to prepare for Keras 3 (#28588) 2024-01-30 17:26:36 +00:00
test_offline.py Fix the expected error in `test_offline_mode_pipeline_exception` (#23022) 2023-04-27 14:22:05 +02:00
test_skip_decorators.py Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
test_versions_utils.py improve dev setup comments and hints (#28495) 2024-01-15 18:36:40 +00:00
tiny_model_summary.json Update tiny model summary file (#27388) 2023-11-23 21:00:39 +01:00