ZhifengKong commited on
Commit
9f748f8
·
verified ·
1 Parent(s): d86cfe4
LICENSE_OPT_IML.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2 align="center"> OPT-IML 175B LICENSE AGREEMENT </h2>
2
+
3
+ This License Agreement (as may be amended in accordance with this License Agreement, **“License”**), between you, or your employer or other entity (if you are entering into this agreement on behalf of your employer or other entity) (**“Licensee”** or **“you”**) and Meta Platforms, Inc. (**“Meta”** or **“we”**) applies to your use of any computer program, algorithm, source code, object code, or software that is made available by Meta under this License (**“Software”**) and any specifications, manuals, documentation, and other written information provided by Meta related to the Software (**“Documentation”**).
4
+
5
+ **By clicking “I Accept” below or by using the Software, you agree to the terms of this License. If you do not agree to this License, then you do not have any rights to use the Software or Documentation (collectively, the “Software Products”), and you must immediately cease using the Software Products. If you are agreeing to be bound by the terms of this License on behalf of your employer or other entity, you represent and warrant to Meta that you have full legal authority to bind your employer or such entity to this License. If you do not have the requisite authority, you may not accept the License or access the Software Products on behalf of your employer or other entity.**
6
+ <br><br>
7
+ 1. **LICENSE GRANT**
8
+ <br><br>
9
+ a. Subject to your compliance with the Documentation and Sections 2, 3, and 5, Meta grants you a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable, royalty free and limited license under Meta’s copyright interests to reproduce, distribute, and create derivative works of the Software solely for your non-commercial research purposes. The foregoing license is personal to you, and you may not assign or sublicense this License or any other rights or obligations under this License without Meta’s prior written consent; any such assignment or sublicense will be void and will automatically and immediately terminate this License.
10
+ <br><br>
11
+ b. You may make a reasonable number of copies of the Documentation solely for use in connection with the license to the Software granted above.
12
+ <br><br>
13
+ c. The grant of rights expressly set forth in this Section 1 (License Grant) are the complete grant of rights to you in the Software Products, and no other licenses are granted, whether by waiver, estoppel, implication, equity or otherwise. Meta and its licensors reserve all rights not expressly granted by this License.
14
+ <br><br>
15
+ 2. **RESTRICTIONS**
16
+ <br><br>
17
+ You will not, and will not permit, assist or cause any third party to:
18
+ <br><br>
19
+ a. use, modify, copy, reproduce, create derivative works of, or distribute the Software Products (or any derivative works thereof, works incorporating the Software Products, or any data produced by the Software), in whole or in part, for (i) any commercial or production purposes, (ii) military purposes or in the service of nuclear technology, (iii) purposes of surveillance, including any research or development relating to surveillance, (iv) biometric processing, (v) in any manner that infringes, misappropriates, or otherwise violates any third-party rights, or (vi) in any manner that violates any applicable law, including accessing the Software Products from an embargoed country as prohibited by the U.S. government, and violating any privacy or security laws, rules, regulations, directives, or governmental requirements (including the General Data Privacy Regulation (Regulation (EU) 2016/679), the California Consumer Privacy Act, and any and all laws governing the processing of biometric information), as well as all amendments and successor laws to any of the foregoing;
20
+ <br><br>
21
+ b. alter or remove copyright and other proprietary notices which appear on or in the Software Products;
22
+ <br><br>
23
+ c. utilize any equipment, device, software, or other means to circumvent or remove any security or protection used by Meta in connection with the Software, or to circumvent or remove any usage restrictions, or to enable functionality disabled by Meta; or
24
+ <br><br>
25
+ d. offer or impose any terms on the Software Products that alter, restrict, or are inconsistent with the terms of this License.
26
+ <br><br>
27
+ 3. **ATTRIBUTION**
28
+ <br><br>
29
+ Together with any copies of the Software Products (as well as derivative works thereof or works incorporating the Software Products) that you distribute, you must provide (i) a copy of this License, and (ii) the following attribution notice: “OPT-IML 175B is licensed under the OPT-175B license, Copyright (c) Meta Platforms, Inc. All Rights Reserved.”
30
+ <br><br>
31
+ 4. **DISCLAIMERS**
32
+ <br><br>
33
+ THE SOFTWARE PRODUCTS ARE PROVIDED “AS IS” and “WITH ALL FAULTS” WITH NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. META EXPRESSLY DISCLAIMS ALL REPRESENTATIONS AND WARRANTIES, EXPRESS OR IMPLIED, WHETHER BY STATUTE, CUSTOM, USAGE OR OTHERWISE AS TO ANY MATTERS RELATED TO THE SOFTWARE PRODUCTS, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, SATISFACTORY QUALITY, OR NON-INFRINGEMENT. META MAKES NO WARRANTIES OR REPRESENTATIONS THAT THE SOFTWARE PRODUCTS WILL BE ERROR FREE OR FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS, OR PRODUCE ANY PARTICULAR RESULTS.
34
+ <br><br>
35
+ 5. **LIMITATION OF LIABILITY**
36
+ <br><br>
37
+ TO THE FULLEST EXTENT PERMITTED BY LAW, IN NO EVENT WILL META BE LIABLE TO YOU (A) UNDER ANY THEORY OF LIABILITY, WHETHER BASED IN CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY, WARRANTY, OR OTHERWISE UNDER THIS LICENSE, OR (B) FOR ANY INDIRECT, CONSEQUENTIAL, EXEMPLARY, INCIDENTAL, PUNITIVE OR SPECIAL DAMAGES OR LOST PROFITS, EVEN IF META HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE SOFTWARE PRODUCTS, THEIR CONSTITUENT COMPONENTS, AND ANY OUTPUT (COLLECTIVELY, **“SOFTWARE MATERIALS”**) ARE NOT DESIGNED OR INTENDED FOR USE IN ANY APPLICATION OR SITUATION WHERE FAILURE OR FAULT OF THE SOFTWARE MATERIALS COULD REASONABLY BE ANTICIPATED TO LEAD TO SERIOUS INJURY OF ANY PERSON, INCLUDING POTENTIAL DISCRIMINATION OR VIOLATION OF AN INDIVIDUAL’S PRIVACY RIGHTS, OR TO SEVERE PHYSICAL, PROPERTY, OR ENVIRONMENTAL DAMAGE (EACH, A **“HIGH-RISK USE”**). IF YOU ELECT TO USE ANY OF THE SOFTWARE MATERIALS FOR A HIGH-RISK USE, YOU DO SO AT YOUR OWN RISK. YOU AGREE TO DESIGN AND IMPLEMENT APPROPRIATE DECISION-MAKING AND RISK-MITIGATION PROCEDURES AND POLICIES IN CONNECTION WITH A HIGH-RISK USE SUCH THAT EVEN IF THERE IS A FAILURE OR FAULT IN ANY OF THE SOFTWARE MATERIALS, THE SAFETY OF PERSONS OR PROPERTY AFFECTED BY THE ACTIVITY STAYS AT A LEVEL THAT IS REASONABLE, APPROPRIATE, AND LAWFUL FOR THE FIELD OF THE HIGH-RISK USE.
38
+ <br><br>
39
+ 6. **INDEMNIFICATION**
40
+ <br><br>
41
+ You will indemnify, defend and hold harmless Meta and our subsidiaries and affiliates, and each of our respective shareholders, directors, officers, employees, agents, successors, and assigns (collectively, the **“Meta Parties”**) from and against any losses, liabilities, damages, fines, penalties, and expenses (including reasonable attorneys’ fees) incurred by any Meta Party in connection with any claim, demand, allegation, lawsuit, proceeding, or investigation (collectively, **“Claims”**) arising out of or related to: (a) your access to or use of the Software Products (as well as any results or data generated from such access or use), including any High-Risk Use (defined below); (b) your violation of this License; or (c) your violation, misappropriation or infringement of any rights of another (including intellectual property or other proprietary rights and privacy rights). You will promptly notify the Meta Parties of any such Claims, and cooperate with Meta Parties in defending such Claims. You will also grant the Meta Parties sole control of the defense or settlement, at Meta’s sole option, of any Claims. This indemnity is in addition to, and not in lieu of, any other indemnities or remedies set forth in a written agreement between you and Meta or the other Meta Parties.
42
+ <br><br>
43
+ 7. **TERMINATION; SURVIVAL**
44
+ <br><br>
45
+ a. This License will automatically terminate upon any breach by you of the terms of this License.
46
+ <br><br>
47
+ b. We may terminate this License, in whole or in part, at any time upon notice (including electronic) to you.
48
+ <br><br>
49
+ c. The following sections survive termination of this License: 2 (Restrictions), 3 (Attribution), 4 (Disclaimers), 5 (Limitation on Liability), 6 (Indemnification) 7 (Termination; Survival), 8 (Third Party Materials), 9 (Trademarks), 10 (Applicable Law; Dispute Resolution), and 11 (Miscellaneous).
50
+ <br><br>
51
+ 8. **THIRD PARTY MATERIALS**
52
+ <br><br>
53
+ The Software Products may contain third-party software or other components (including free and open source software) (all of the foregoing, **“Third Party Materials”**), which are subject to the license terms of the respective third-party licensors. Your dealings or correspondence with third parties and your use of or interaction with any Third Party Materials are solely between you and the third party. Meta does not control or endorse, and makes no representations or warranties regarding, any Third Party Materials, and your access to and use of such Third Party Materials are at your own risk.
54
+ <br><br>
55
+ 9. **TRADEMARKS**
56
+ <br><br>
57
+ Licensee has not been granted any trademark license as part of this License and may not use any name or mark associated with Meta without the prior written permission of Meta, except to the extent necessary to make the reference required by the “ATTRIBUTION” section of this Agreement.
58
+ <br><br>
59
+ 10. **APPLICABLE LAW; DISPUTE RESOLUTION**
60
+ <br><br>
61
+ This License will be governed and construed under the laws of the State of California without regard to conflicts of law provisions. Any suit or proceeding arising out of or relating to this License will be brought in the federal or state courts, as applicable, in San Mateo County, California, and each party irrevocably submits to the jurisdiction and venue of such courts.
62
+ <br><br>
63
+ 11. **MISCELLANEOUS**
64
+ <br><br>
65
+ If any provision or part of a provision of this License is unlawful, void or unenforceable, that provision or part of the provision is deemed severed from this License, and will not affect the validity and enforceability of any remaining provisions. The failure of Meta to exercise or enforce any right or provision of this License will not operate as a waiver of such right or provision. This License does not confer any third-party beneficiary rights upon any other person or entity. This License, together with the Documentation, contains the entire understanding between you and Meta regarding the subject matter of this License, and supersedes all other written or oral agreements and understandings between you and Meta regarding such subject matter. No change or addition to any provision of this License will be binding unless it is in writing and signed by an authorized representative of both you and Meta.
audio_flamingo_arch.png ADDED
chat.yaml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ train_config:
2
+ expdir: YOUR_DATA_ROOT_DIR/audio-flamingo-data/checkpoint
3
+ run_name: chat
4
+ delete_previous_checkpoint: false
5
+ batch_size: 4
6
+ gradient_accumulation_steps: 4 # global batchsize = 128
7
+ seed: 42
8
+ learning_rate: 0.00002
9
+ lr_scheduler: constant
10
+ loss_multiplier: 1.0
11
+ warmup_steps: 1875
12
+ weight_decay: 0.1
13
+ precision: fp32
14
+ gradient_checkpointing: False
15
+ num_epochs: 1
16
+ offline: false
17
+ freeze_lm_embeddings: false
18
+ logging_steps: 10
19
+ dist_backend: nccl
20
+ dist_url: env://
21
+ no_set_device_rank: false
22
+ fsdp: true
23
+ fsdp_use_orig_params: false # Passed into the FSDP constructor. Enables param_groups and gradient masking for weight_decay. Does not work with OPT.
24
+ fsdp_sharding_strategy: full # full, hybrid
25
+ horovod: false
26
+
27
+ # Chat SFT hparams
28
+ sft_config:
29
+ pretrained_path: YOUR_DATA_ROOT_DIR/audio-flamingo-data/checkpoint/foundation_sft_4_shot/
30
+ pretrained_ckpt: checkpoint_99.pt
31
+ unfreeze_full_lm: true
32
+
33
+ data_config:
34
+ dataset_blending_global_weight: 1.0
35
+
36
+ dataset_blending_config:
37
+ dialog_AudioSetSL-Dialog/train:
38
+ weight: 1.0
39
+ prefix_prob: 1.0
40
+
41
+ dialog_MusicCaps-Dialog/train:
42
+ weight: 5.0
43
+ prefix_prob: 1.0
44
+
45
+ dataset_file_root: YOUR_DATA_ROOT_DIR/audio-flamingo-data/dataset_files
46
+ data_root: YOUR_DATA_ROOT_DIR/datasets
47
+ dataset_blending_output: dataset_blending.json
48
+ max_tokens: 512
49
+ num_workers: 4
50
+
51
+ clap_config:
52
+ # method: laion-clap
53
+ # audio_embed_dim: 512
54
+ # model_name: 630k-fusion-best
55
+ # checkpoint: YOUR_DATA_ROOT_DIR/audio-flamingo-data/laion-clap-pretrained/laion_clap/630k-fusion-best.pt
56
+
57
+ method: microsoft-clap
58
+ audio_embed_dim: 1024
59
+ config_root: YOUR_REPO_ROOT_DIR/chat/my_ms_clap/src/configs
60
+ model_name: 'clapcap'
61
+ checkpoint: YOUR_DATA_ROOT_DIR/audio-flamingo-data/clap/clapcap_weights_2023.pth
62
+
63
+ window_length: 7.0 # seconds
64
+ window_overlap: 5.25 # seconds
65
+ max_num_window: 16 # total = 33.25 seconds
66
+ max_num_fewshot: 4 # number of fewshot samples
67
+
68
+ model_config:
69
+ cache_dir: YOUR_DATA_ROOT_DIR/audio-flamingo-data/LLM_pretrained/.cache
70
+
71
+ lang_encoder_path: facebook/opt-iml-max-1.3b
72
+ tokenizer_path: facebook/opt-iml-max-1.3b
73
+ cross_attn_every_n_layers: 1
74
+ audio_transformer_kwargs: {
75
+ n_head: 8,
76
+ n_layers: 3,
77
+ d_inner: 2048,
78
+ max_num_media: 128, # must be >= max_num_window * num_fewshot_samples (4)
79
+ max_window_per_audio: 16, # must = max_num_window
80
+ }
foundation_pretrain.yaml ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ train_config:
2
+ expdir: YOUR_DATA_ROOT_DIR/audio-flamingo-data/checkpoint
3
+ run_name: foundation_pretrain
4
+ delete_previous_checkpoint: true
5
+ batch_size: 6
6
+ gradient_accumulation_steps: 8 # global batchsize = 384
7
+ seed: 42
8
+ learning_rate: 0.0001
9
+ lr_scheduler: constant
10
+ loss_multiplier: 1.0
11
+ warmup_steps: 1875
12
+ weight_decay: 0.1
13
+ precision: amp_bf16
14
+ gradient_checkpointing: False
15
+ num_epochs: 100 # num_epochs * dataset_blending_global_weight = 1
16
+ offline: false
17
+ freeze_lm_embeddings: true
18
+ logging_steps: 10
19
+ dist_backend: nccl
20
+ dist_url: env://
21
+ no_set_device_rank: false
22
+ fsdp: true
23
+ fsdp_use_orig_params: false # Passed into the FSDP constructor. Enables param_groups and gradient masking for weight_decay. Does not work with OPT.
24
+ fsdp_sharding_strategy: full # full, hybrid
25
+ horovod: false
26
+
27
+ data_config:
28
+ dataset_blending_global_weight: 0.01
29
+
30
+ dataset_blending_config:
31
+
32
+ # Audio QA
33
+
34
+ OpenAQA-AQA/train:
35
+ weight: 1.0
36
+ prefix_prob: 0.0
37
+ augmentations:
38
+ do_nothing: 1.0
39
+
40
+ # Audio Captioning
41
+
42
+ BBCSoundEffects-AudioDescription/train:
43
+ weight: 5.0
44
+ prefix_prob: 0.5
45
+ augmentations:
46
+ do_nothing: 1.0
47
+
48
+ CLAP_freesound-AudioCaptioning/train:
49
+ weight: 1.0
50
+ prefix_prob: 0.5
51
+ augmentations:
52
+ do_nothing: 1.0
53
+
54
+ SoundDescs-AudioDescription/train:
55
+ weight: 1.0
56
+ prefix_prob: 0.5
57
+ augmentations:
58
+ do_nothing: 1.0
59
+
60
+ WavCaps-AudioSet_SL-AudioCaptioning/train:
61
+ weight: 1.0
62
+ prefix_prob: 0.5
63
+ augmentations:
64
+ do_nothing: 1.0
65
+
66
+ WavCaps-BBC_Sound_Effects-AudioCaptioning/train:
67
+ weight: 2.0
68
+ prefix_prob: 0.5
69
+ augmentations:
70
+ do_nothing: 1.0
71
+
72
+ WavCaps-FreeSound-AudioCaptioning/train:
73
+ weight: 2.0
74
+ prefix_prob: 0.5
75
+ augmentations:
76
+ do_nothing: 1.0
77
+
78
+ WavCaps-SoundBible-AudioCaptioning/train:
79
+ weight: 5.0
80
+ prefix_prob: 0.5
81
+ augmentations:
82
+ do_nothing: 1.0
83
+
84
+ # Audio Classification
85
+
86
+ AudioSetFullwoAudioMusicCaps-EventClassification/train:
87
+ weight: 1.0
88
+ prefix_prob: 0.5
89
+ augmentations:
90
+ num_words: 0.8
91
+ do_nothing: 0.2
92
+
93
+ WavText5K-Tagging/train:
94
+ weight: 3.0
95
+ prefix_prob: 0.5
96
+ augmentations:
97
+ num_words: 0.8
98
+ do_nothing: 0.2
99
+
100
+ # Speech Emotion Classification
101
+
102
+ MSP-PODCAST-Publish-1.9-EmotionClassification/train:
103
+ weight: 1.2
104
+ prefix_prob: 0.5
105
+ augmentations:
106
+ provide_all_labels: 0.9
107
+ do_nothing: 0.1
108
+
109
+ MELD-EmotionClassification/train:
110
+ weight: 1.2
111
+ prefix_prob: 0.5
112
+ augmentations:
113
+ provide_all_labels: 0.9
114
+ do_nothing: 0.1
115
+
116
+ MELD-SentimentClassification/train:
117
+ weight: 1.2
118
+ prefix_prob: 0.5
119
+ augmentations:
120
+ provide_all_labels: 0.9
121
+ do_nothing: 0.1
122
+
123
+ # Music QA
124
+
125
+ Music-AVQA-AVQA_All/train:
126
+ weight: 3.0
127
+ prefix_prob: 0.5
128
+ augmentations:
129
+ AQA_binary_instruction: 1.0
130
+
131
+ MU-LLAMA-AQA/train:
132
+ weight: 1.2
133
+ prefix_prob: 0.5
134
+ augmentations:
135
+ do_nothing: 1.0
136
+
137
+ # Music Captioning
138
+
139
+ LP-MusicCaps-MSD-AudioCaptioning/train:
140
+ weight: 1.0
141
+ prefix_prob: 0.5
142
+ augmentations:
143
+ do_nothing: 1.0
144
+
145
+ # Music Understanding
146
+
147
+ NSynth-MIR/train:
148
+ weight: 0.4
149
+ prefix_prob: 0.5
150
+ augmentations:
151
+ do_nothing: 1.0
152
+
153
+ mtg-jamendo-MusicTagging/train:
154
+ weight: 1.0
155
+ prefix_prob: 0.5
156
+ augmentations:
157
+ do_nothing: 1.0
158
+
159
+ dataset_file_root: YOUR_DATA_ROOT_DIR/audio-flamingo-data/dataset_files
160
+ data_root: YOUR_DATA_ROOT_DIR/datasets
161
+ dataset_blending_output: dataset_blending.json
162
+ max_tokens: 512
163
+ num_workers: 4
164
+
165
+ valid_dataset_config:
166
+ CLAP_freesound-AudioCaptioning/test: true
167
+ SoundDescs-AudioDescription/val: true
168
+ Clotho-AQA-EventClassification/val: true
169
+ MSP-PODCAST-Publish-1.9-EmotionClassification/val: true
170
+ MELD-EmotionClassification/val: true
171
+ MELD-SentimentClassification/val: true
172
+ MU-LLAMA-AQA/test: true
173
+ LP-MusicCaps-MSD-AudioCaptioning/val: true
174
+ NSynth-MIR/val: true
175
+ mtg-jamendo-MusicTagging/val: true
176
+
177
+ clap_config:
178
+ # method: laion-clap
179
+ # audio_embed_dim: 512
180
+ # model_name: 630k-fusion-best
181
+ # checkpoint: YOUR_DATA_ROOT_DIR/audio-flamingo-data/laion-clap-pretrained/laion_clap/630k-fusion-best.pt
182
+
183
+ method: microsoft-clap
184
+ audio_embed_dim: 1024
185
+ config_root: YOUR_REPO_ROOT_DIR/foundation/my_ms_clap/src/configs
186
+ model_name: 'clapcap'
187
+ checkpoint: YOUR_DATA_ROOT_DIR/audio-flamingo-data/clap/clapcap_weights_2023.pth
188
+
189
+ window_length: 7.0 # seconds
190
+ window_overlap: 5.25 # seconds
191
+ max_num_window: 16 # total = 33.25 seconds
192
+ max_num_fewshot: 8 # number of fewshot samples
193
+
194
+ model_config:
195
+ cache_dir: YOUR_DATA_ROOT_DIR/audio-flamingo-data/LLM_pretrained/.cache
196
+
197
+ lang_encoder_path: facebook/opt-iml-max-1.3b
198
+ tokenizer_path: facebook/opt-iml-max-1.3b
199
+ cross_attn_every_n_layers: 1
200
+ audio_transformer_kwargs: {
201
+ n_head: 8,
202
+ n_layers: 3,
203
+ d_inner: 2048,
204
+ max_num_media: 128, # must >= max_num_window * num_fewshot_samples
205
+ max_window_per_audio: 16, # must = max_num_window
206
+ }
foundation_sft_8_shot.yaml ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ train_config:
2
+ expdir: YOUR_DATA_ROOT_DIR/audio-flamingo-data/checkpoint
3
+ run_name: foundation_sft_8_shot
4
+ delete_previous_checkpoint: true
5
+ batch_size: 4
6
+ gradient_accumulation_steps: 4 # global batchsize = 128
7
+ seed: 42
8
+ learning_rate: 0.00002
9
+ lr_scheduler: constant
10
+ loss_multiplier: 1.0
11
+ warmup_steps: 1875
12
+ weight_decay: 0.1
13
+ precision: fp32
14
+ gradient_checkpointing: False
15
+ num_epochs: 100 # num_epochs * dataset_blending_global_weight = 1
16
+ offline: false
17
+ freeze_lm_embeddings: false
18
+ logging_steps: 10
19
+ dist_backend: nccl
20
+ dist_url: env://
21
+ no_set_device_rank: false
22
+ fsdp: true
23
+ fsdp_use_orig_params: false # Passed into the FSDP constructor. Enables param_groups and gradient masking for weight_decay. Does not work with OPT.
24
+ fsdp_sharding_strategy: full # full, hybrid
25
+ horovod: false
26
+
27
+ # SFT hparams
28
+ sft_config:
29
+ pretrained_path: YOUR_DATA_ROOT_DIR/audio-flamingo-data/checkpoint/foundation_pretrain/
30
+ pretrained_ckpt: checkpoint_99.pt
31
+ unfreeze_full_lm: true
32
+
33
+ data_config:
34
+ dataset_blending_global_weight: 0.01
35
+
36
+ dataset_blending_config:
37
+
38
+ # Audio QA
39
+
40
+ Clotho-AQA-AQA/train:
41
+ weight: 3.5
42
+ prefix_prob: 1.0
43
+ augmentations:
44
+ AQA_binary_instruction: 1.0
45
+ Clotho-AQA-AQA/interleaved_knn-train:
46
+ weight: 0.5
47
+ prefix_prob: 1.0
48
+ augmentations:
49
+ AQA_binary_instruction: 1.0
50
+
51
+ OpenAQA-AQA/train:
52
+ weight: 0.1
53
+ prefix_prob: 1.0
54
+ augmentations:
55
+ do_nothing: 1.0
56
+
57
+ # Audio Captioning
58
+
59
+ Clotho-v2-AudioCaptioning/train:
60
+ weight: 2.0
61
+ prefix_prob: 1.0
62
+ augmentations:
63
+ AC_short: 1.0
64
+ Clotho-v2-AudioCaptioning/interleaved_knn-train:
65
+ weight: 0.5
66
+ prefix_prob: 1.0
67
+ augmentations:
68
+ AC_short: 1.0
69
+
70
+ Epidemic_sound-AudioCaptioning/train:
71
+ weight: 0.8
72
+ prefix_prob: 1.0
73
+ augmentations:
74
+ AC_short: 1.0
75
+ Epidemic_sound-AudioCaptioning/interleaved_knn-train:
76
+ weight: 0.2
77
+ prefix_prob: 1.0
78
+ augmentations:
79
+ AC_short: 1.0
80
+
81
+ MACS-AudioCaptioning/train:
82
+ weight: 0.8
83
+ prefix_prob: 1.0
84
+ augmentations:
85
+ AC_short: 1.0
86
+ MACS-AudioCaptioning/interleaved_knn-train:
87
+ weight: 0.2
88
+ prefix_prob: 1.0
89
+ augmentations:
90
+ AC_short: 1.0
91
+
92
+ # Audio Classification
93
+
94
+ FSD50k-EventClassification/train:
95
+ weight: 0.9
96
+ prefix_prob: 1.0
97
+ augmentations:
98
+ default: 1.0
99
+ FSD50k-EventClassification/interleaved_knn-train:
100
+ weight: 0.3
101
+ prefix_prob: 1.0
102
+ augmentations:
103
+ default: 1.0
104
+
105
+ CochlScene-SceneClassification/train:
106
+ weight: 1.2
107
+ prefix_prob: 1.0
108
+ augmentations:
109
+ provide_all_labels: 0.9
110
+ default: 0.1
111
+ CochlScene-SceneClassification/interleaved_knn-train:
112
+ weight: 0.3
113
+ prefix_prob: 1.0
114
+ augmentations:
115
+ provide_all_labels: 0.9
116
+ default: 0.1
117
+
118
+ NonSpeech7k-EventClassification/train:
119
+ weight: 2.4
120
+ prefix_prob: 1.0
121
+ augmentations:
122
+ provide_all_labels: 0.9
123
+ default: 0.1
124
+ NonSpeech7k-EventClassification/interleaved_knn-train:
125
+ weight: 0.6
126
+ prefix_prob: 1.0
127
+ augmentations:
128
+ provide_all_labels: 0.9
129
+ default: 0.1
130
+
131
+ chime-home-EventClassification/train:
132
+ weight: 1.5
133
+ prefix_prob: 1.0
134
+ augmentations:
135
+ default: 0.5
136
+ num_words: 0.5
137
+ chime-home-EventClassification/interleaved_knn-train:
138
+ weight: 0.5
139
+ prefix_prob: 1.0
140
+ augmentations:
141
+ default: 0.5
142
+ num_words: 0.5
143
+
144
+ SONYC-UST-EventClassification/train:
145
+ weight: 0.8
146
+ prefix_prob: 1.0
147
+ augmentations:
148
+ default: 0.5
149
+ num_words: 0.5
150
+ SONYC-UST-EventClassification/interleaved_knn-train:
151
+ weight: 0.2
152
+ prefix_prob: 1.0
153
+ augmentations:
154
+ default: 0.5
155
+ num_words: 0.5
156
+
157
+ # Speech Emotion Classification
158
+
159
+ emov-db-EmotionClassification/train:
160
+ weight: 1.6
161
+ prefix_prob: 1.0
162
+ augmentations:
163
+ provide_all_labels: 0.9
164
+ default: 0.1
165
+ emov-db-EmotionClassification/interleaved_knn-train:
166
+ weight: 0.4
167
+ prefix_prob: 1.0
168
+ augmentations:
169
+ provide_all_labels: 0.9
170
+ default: 0.1
171
+
172
+ jl-corpus-EmotionClassification/train:
173
+ weight: 6.0
174
+ prefix_prob: 1.0
175
+ augmentations:
176
+ provide_all_labels: 0.9
177
+ default: 0.1
178
+ jl-corpus-EmotionClassification/interleaved_knn-train:
179
+ weight: 1.5
180
+ prefix_prob: 1.0
181
+ augmentations:
182
+ provide_all_labels: 0.9
183
+ default: 0.1
184
+
185
+ tess-EmotionClassification/train:
186
+ weight: 2.0
187
+ prefix_prob: 1.0
188
+ augmentations:
189
+ provide_all_labels: 0.9
190
+ default: 0.1
191
+ tess-EmotionClassification/interleaved_knn-train:
192
+ weight: 0.5
193
+ prefix_prob: 1.0
194
+ augmentations:
195
+ provide_all_labels: 0.9
196
+ default: 0.1
197
+
198
+ OMGEmotion-EmotionClassification/train:
199
+ weight: 3.0
200
+ prefix_prob: 1.0
201
+ augmentations:
202
+ provide_all_labels: 0.9
203
+ default: 0.1
204
+
205
+ # Music QA
206
+
207
+ Music-AVQA-AQA_All/train:
208
+ weight: 5.0
209
+ prefix_prob: 1.0
210
+ augmentations:
211
+ AQA_binary_instruction: 1.0
212
+ Music-AVQA-AQA_All/interleaved_knn-train:
213
+ weight: 1.0
214
+ prefix_prob: 1.0
215
+ augmentations:
216
+ AQA_binary_instruction: 1.0
217
+
218
+ MU-LLAMA-AQA/train:
219
+ weight: 0.35
220
+ prefix_prob: 1.0
221
+ augmentations:
222
+ do_nothing: 1.0
223
+ MU-LLAMA-AQA/interleaved_knn-train:
224
+ weight: 0.05
225
+ prefix_prob: 1.0
226
+ augmentations:
227
+ do_nothing: 1.0
228
+
229
+ # Music Captioning
230
+
231
+ LP-MusicCaps-MSD-AudioCaptioning/train:
232
+ weight: 0.025
233
+ prefix_prob: 1.0
234
+ augmentations:
235
+ AC_paragraph: 1.0
236
+ LP-MusicCaps-MSD-AudioCaptioning/interleaved_knn-train:
237
+ weight: 0.007
238
+ prefix_prob: 1.0
239
+ augmentations:
240
+ AC_paragraph: 1.0
241
+
242
+ LP-MusicCaps-MC-AudioCaptioning/train:
243
+ weight: 2.0
244
+ prefix_prob: 1.0
245
+ augmentations:
246
+ AC_paragraph: 1.0
247
+
248
+ LP-MusicCaps-MTT-AudioCaptioning/train:
249
+ weight: 0.8
250
+ prefix_prob: 1.0
251
+ augmentations:
252
+ AC_long: 1.0
253
+ LP-MusicCaps-MTT-AudioCaptioning/interleaved_knn-train:
254
+ weight: 0.2
255
+ prefix_prob: 1.0
256
+ augmentations:
257
+ AC_long: 1.0
258
+
259
+ MusicCaps-AudioCaptioning/train:
260
+ weight: 6.0
261
+ prefix_prob: 1.0
262
+ augmentations:
263
+ AC_paragraph: 1.0
264
+
265
+ # Music Understanding
266
+
267
+ NSynth-MIR/train:
268
+ weight: 1.0
269
+ prefix_prob: 1.0
270
+ augmentations:
271
+ do_nothing: 1.0
272
+ NSynth-MIR/interleaved_knn-train:
273
+ weight: 1.0
274
+ prefix_prob: 1.0
275
+ augmentations:
276
+ do_nothing: 1.0
277
+
278
+ mtg-jamendo-MusicTagging/train:
279
+ weight: 0.1
280
+ prefix_prob: 1.0
281
+ augmentations:
282
+ default: 1.0
283
+
284
+ FMA-GenreClassification/train:
285
+ weight: 0.4
286
+ prefix_prob: 1.0
287
+ augmentations:
288
+ do_nothing: 1.0
289
+ FMA-GenreClassification/interleaved_knn-train:
290
+ weight: 0.3
291
+ prefix_prob: 1.0
292
+ augmentations:
293
+ do_nothing: 1.0
294
+
295
+ musdbhq-InstrClassification/train:
296
+ weight: 1.0
297
+ prefix_prob: 1.0
298
+ augmentations:
299
+ provide_all_labels: 0.9
300
+ default: 0.1
301
+
302
+ dataset_file_root: YOUR_DATA_ROOT_DIR/audio-flamingo-data/dataset_files
303
+ data_root: YOUR_DATA_ROOT_DIR/datasets
304
+ dataset_blending_output: dataset_blending.json
305
+ max_tokens: 512
306
+ num_workers: 4
307
+
308
+ valid_dataset_config:
309
+ Clotho-AQA-AQA/val: true
310
+ Clotho-v2-AudioCaptioning/val: true
311
+ Clotho-v2-AudioCaptioning/interleaved_knn-val: true
312
+ CochlScene-SceneClassification/val: true
313
+ CochlScene-SceneClassification/interleaved_knn-val: true
314
+ SONYC-UST-EventClassification/val: true
315
+ SONYC-UST-EventClassification/interleaved_knn-val: true
316
+ emov-db-EmotionClassification/val: true
317
+ emov-db-EmotionClassification/interleaved_knn-val: true
318
+ jl-corpus-EmotionClassification/val: true
319
+ jl-corpus-EmotionClassification/interleaved_knn-val: true
320
+ tess-EmotionClassification/val: true
321
+ tess-EmotionClassification/interleaved_knn-val: true
322
+ OMGEmotion-EmotionClassification/val: true
323
+ Music-AVQA-AQA_All/val: true
324
+ Music-AVQA-AQA_All/interleaved_knn-val: true
325
+ LP-MusicCaps-MTT-AudioCaptioning/val: true
326
+ LP-MusicCaps-MTT-AudioCaptioning/interleaved_knn-val: true
327
+ NSynth-MIR/val: true
328
+ mtg-jamendo-MusicTagging/val: true
329
+
330
+ clap_config:
331
+ # method: laion-clap
332
+ # audio_embed_dim: 512
333
+ # model_name: 630k-fusion-best
334
+ # checkpoint: YOUR_DATA_ROOT_DIR/audio-flamingo-data/laion-clap-pretrained/laion_clap/630k-fusion-best.pt
335
+
336
+ method: microsoft-clap
337
+ audio_embed_dim: 1024
338
+ config_root: YOUR_REPO_ROOT_DIR/foundation/my_ms_clap/src/configs
339
+ model_name: 'clapcap'
340
+ checkpoint: YOUR_DATA_ROOT_DIR/audio-flamingo-data/clap/clapcap_weights_2023.pth
341
+
342
+ window_length: 7.0 # seconds
343
+ window_overlap: 5.25 # seconds
344
+ max_num_window: 16 # total = 33.25 seconds
345
+ max_num_fewshot: 8 # number of fewshot samples
346
+
347
+ model_config:
348
+ cache_dir: YOUR_DATA_ROOT_DIR/audio-flamingo-data/LLM_pretrained/.cache
349
+
350
+ lang_encoder_path: facebook/opt-iml-max-1.3b
351
+ tokenizer_path: facebook/opt-iml-max-1.3b
352
+ cross_attn_every_n_layers: 1
353
+ audio_transformer_kwargs: {
354
+ n_head: 8,
355
+ n_layers: 3,
356
+ d_inner: 2048,
357
+ max_num_media: 128, # must >= max_num_window * num_fewshot_samples
358
+ max_window_per_audio: 16, # must = max_num_window
359
+ }