transformers/tests
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
..
benchmark [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
bettertransformer Fixed malapropism error (#26660) 2023-10-09 11:04:57 +02:00
deepspeed fix failing trainer ds tests (#29057) 2024-02-16 17:18:45 +05:30
extended [tests] make test_trainer_log_level_replica to run on accelerators with more than 2 devices (#29609) 2024-03-13 17:44:35 +00:00
fixtures [WIP] add SpeechT5 model (#18922) 2023-02-03 12:43:46 -05:00
fsdp Add support for FSDP+QLoRA and DeepSpeed ZeRO3+QLoRA (#29587) 2024-03-13 22:03:02 +05:30
generation [tests] use torch_device instead of auto for model testing (#29531) 2024-03-08 11:21:43 +00:00
models Add MusicGen Melody (#28819) 2024-03-18 13:06:12 +00:00
optimization Make schedulers picklable by making lr_lambda fns global (#21768) 2023-03-02 12:08:43 -05:00
peft_integration FIX [CI]: Fix failing tests for peft integration (#29330) 2024-02-29 03:56:16 +01:00
pipelines fix image-to-text batch incorrect output issue (#29342) 2024-03-08 11:11:10 +00:00
quantization [Quantization] Quanto quantizer (#29023) 2024-03-15 11:51:29 -04:00
repo_utils Allow # Ignore copy (#27328) 2023-12-07 10:00:08 +01:00
sagemaker Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
tokenization Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
tools Add support for for loops in python interpreter (#24429) 2023-06-26 09:58:14 -04:00
trainer Trainer: fail early in the presence of an unsavable generation_config (#29675) 2024-03-15 12:59:10 +00:00
utils Add MusicGen Melody (#28819) 2024-03-18 13:06:12 +00:00
__init__.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_backbone_common.py Align backbone stage selection with out_indices & out_features (#27606) 2023-12-20 18:33:17 +00:00
test_cache_utils.py Generate: add tests for caches with pad_to_multiple_of (#29462) 2024-03-06 10:57:04 +00:00
test_configuration_common.py [ PretrainedConfig] Improve messaging (#27438) 2023-11-15 14:10:39 +01:00
test_configuration_utils.py [tests] remove deprecated tests for model loading (#29450) 2024-03-15 14:18:41 +00:00
test_feature_extraction_common.py Split common test from core tests (#24284) 2023-06-15 07:30:24 -04:00
test_feature_extraction_utils.py [tests] remove deprecated tests for model loading (#29450) 2024-03-15 14:18:41 +00:00
test_image_processing_common.py Raise unused kwargs image processor (#29063) 2024-02-20 16:20:20 +01:00
test_image_processing_utils.py [tests] remove deprecated tests for model loading (#29450) 2024-03-15 14:18:41 +00:00
test_image_transforms.py Normalize floating point cast (#27249) 2023-11-10 15:35:27 +00:00
test_modeling_common.py Fix batching tests for new models (Mamba and SegGPT) (#29633) 2024-03-13 17:52:49 +00:00
test_modeling_flax_common.py [Flax] Update no init test for Flax v0.7.1 (#28735) 2024-01-26 18:20:39 +00:00
test_modeling_flax_utils.py Enable safetensors conversion from PyTorch to other frameworks without the torch requirement (#27599) 2024-01-23 10:28:23 +01:00
test_modeling_tf_common.py Add tf_keras imports to prepare for Keras 3 (#28588) 2024-01-30 17:26:36 +00:00
test_modeling_tf_utils.py [tests] remove deprecated tests for model loading (#29450) 2024-03-15 14:18:41 +00:00
test_modeling_utils.py [tests] remove deprecated tests for model loading (#29450) 2024-03-15 14:18:41 +00:00
test_pipeline_mixin.py Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
test_processing_common.py Don't save processor_config.json if a processor has no extra attribute (#28584) 2024-01-19 09:59:14 +00:00
test_sequence_feature_extraction_common.py Fix typo (#25966) 2023-09-05 10:12:25 +02:00
test_tokenization_common.py Allow apply_chat_template to pass kwargs to the template and support a dict of templates (#29658) 2024-03-14 18:23:14 +00:00
test_tokenization_utils.py [tests] remove deprecated tests for model loading (#29450) 2024-03-15 14:18:41 +00:00