Any-to-Any
Transformers
Safetensors
lfm3_audio
automatic-speech-recognition
liquid
lfm3
audio
speech
edge
conversational
multilingual
custom_code
Instructions to use eustlb/LFM3-Audio-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eustlb/LFM3-Audio-2B with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMultimodalLM model = AutoModelForMultimodalLM.from_pretrained("eustlb/LFM3-Audio-2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
config and generation_config: keep every key of the original
Browse files- config.json +253 -3
- generation_config.json +16 -6
config.json
CHANGED
|
@@ -2,6 +2,259 @@
|
|
| 2 |
"architectures": [
|
| 3 |
"Lfm3AudioForConditionalGeneration"
|
| 4 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
| 95 |
-
"interleaved_n_audio": 12,
|
| 96 |
-
"interleaved_n_text": 6,
|
| 97 |
"maskgit_schedule": [
|
| 98 |
4,
|
| 99 |
4,
|
|
@@ -101,7 +352,6 @@
|
|
| 101 |
],
|
| 102 |
"mixed_end_token_id": 125016,
|
| 103 |
"mixed_start_token_id": 125015,
|
| 104 |
-
"model_type": "lfm3_audio",
|
| 105 |
"num_codebooks": 12,
|
| 106 |
"projector_hidden_act": "gelu",
|
| 107 |
"text_config": {
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"Lfm3AudioForConditionalGeneration"
|
| 4 |
],
|
| 5 |
+
"model_type": "lfm3_audio",
|
| 6 |
+
"format_version": 1,
|
| 7 |
+
"codebooks": 12,
|
| 8 |
+
"audio_vocab_size": 2017,
|
| 9 |
+
"maskgit_steps": 3,
|
| 10 |
+
"interleaved_n_text": 6,
|
| 11 |
+
"interleaved_n_audio": 12,
|
| 12 |
+
"preprocessor": {
|
| 13 |
+
"feature_type": "log_mel",
|
| 14 |
+
"sample_rate": 16000,
|
| 15 |
+
"waveform_dtype": "float32",
|
| 16 |
+
"channel_reduction": "mean",
|
| 17 |
+
"n_mels": 128,
|
| 18 |
+
"n_fft": 400,
|
| 19 |
+
"win_length": 400,
|
| 20 |
+
"hop_length": 160,
|
| 21 |
+
"window": "hann",
|
| 22 |
+
"window_periodic": true,
|
| 23 |
+
"center": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
+
"onesided": true,
|
| 26 |
+
"power": 2.0,
|
| 27 |
+
"f_min": 0.0,
|
| 28 |
+
"f_max": 8000.0,
|
| 29 |
+
"mel_scale": "slaney",
|
| 30 |
+
"mel_norm": "slaney",
|
| 31 |
+
"log_base": 10,
|
| 32 |
+
"logmel_floor": -12.0,
|
| 33 |
+
"normalization": {
|
| 34 |
+
"type": "affine",
|
| 35 |
+
"offset": 4.0,
|
| 36 |
+
"divisor": 4.0
|
| 37 |
+
},
|
| 38 |
+
"padding": {
|
| 39 |
+
"side": "right",
|
| 40 |
+
"mode": "constant",
|
| 41 |
+
"value": 0.0,
|
| 42 |
+
"minimum_samples": 400,
|
| 43 |
+
"length_alignment_offset": 400,
|
| 44 |
+
"length_alignment_multiple": 160
|
| 45 |
+
}
|
| 46 |
+
},
|
| 47 |
+
"tokenizer": {
|
| 48 |
+
"repo_id": "LiquidAI/liquid7.1_tokenizer",
|
| 49 |
+
"revision": "39badc470af6cdf6f6a6fbb4d6d1c4d1929b5b96"
|
| 50 |
+
},
|
| 51 |
+
"encoder": {
|
| 52 |
+
"dim_in": 128,
|
| 53 |
+
"dim_conv": 256,
|
| 54 |
+
"dim_out": 768,
|
| 55 |
+
"sliding_window": 32,
|
| 56 |
+
"lfm": {
|
| 57 |
+
"transformers_version": "5.19.0.dev0",
|
| 58 |
+
"architectures": null,
|
| 59 |
+
"output_hidden_states": false,
|
| 60 |
+
"return_dict": true,
|
| 61 |
+
"dtype": "float32",
|
| 62 |
+
"chunk_size_feed_forward": 0,
|
| 63 |
+
"is_encoder_decoder": false,
|
| 64 |
+
"id2label": {
|
| 65 |
+
"0": "LABEL_0",
|
| 66 |
+
"1": "LABEL_1"
|
| 67 |
+
},
|
| 68 |
+
"label2id": {
|
| 69 |
+
"LABEL_0": 0,
|
| 70 |
+
"LABEL_1": 1
|
| 71 |
+
},
|
| 72 |
+
"problem_type": null,
|
| 73 |
+
"vocab_size": 2,
|
| 74 |
+
"hidden_size": 768,
|
| 75 |
+
"intermediate_size": 2560,
|
| 76 |
+
"num_hidden_layers": 17,
|
| 77 |
+
"num_attention_heads": 8,
|
| 78 |
+
"num_key_value_heads": 4,
|
| 79 |
+
"max_position_embeddings": 128000,
|
| 80 |
+
"initializer_range": 0.02,
|
| 81 |
+
"norm_eps": 1e-05,
|
| 82 |
+
"use_cache": true,
|
| 83 |
+
"pad_token_id": 0,
|
| 84 |
+
"bos_token_id": 1,
|
| 85 |
+
"eos_token_id": null,
|
| 86 |
+
"tie_word_embeddings": true,
|
| 87 |
+
"rope_parameters": {
|
| 88 |
+
"rope_theta": 1000000.0,
|
| 89 |
+
"rope_type": "default"
|
| 90 |
+
},
|
| 91 |
+
"conv_bias": false,
|
| 92 |
+
"conv_L_cache": 3,
|
| 93 |
+
"block_multiple_of": 256,
|
| 94 |
+
"block_ffn_dim_multiplier": 1.0,
|
| 95 |
+
"block_auto_adjust_ff_dim": true,
|
| 96 |
+
"full_attn_idxs": null,
|
| 97 |
+
"layer_types": [
|
| 98 |
+
"conv",
|
| 99 |
+
"conv",
|
| 100 |
+
"full_attention",
|
| 101 |
+
"conv",
|
| 102 |
+
"conv",
|
| 103 |
+
"full_attention",
|
| 104 |
+
"conv",
|
| 105 |
+
"conv",
|
| 106 |
+
"full_attention",
|
| 107 |
+
"conv",
|
| 108 |
+
"conv",
|
| 109 |
+
"full_attention",
|
| 110 |
+
"conv",
|
| 111 |
+
"conv",
|
| 112 |
+
"full_attention",
|
| 113 |
+
"full_attention",
|
| 114 |
+
"full_attention"
|
| 115 |
+
],
|
| 116 |
+
"_name_or_path": "",
|
| 117 |
+
"model_type": "lfm2",
|
| 118 |
+
"output_attentions": false
|
| 119 |
+
}
|
| 120 |
+
},
|
| 121 |
+
"depthformer": {
|
| 122 |
+
"transformers_version": "5.19.0.dev0",
|
| 123 |
+
"architectures": null,
|
| 124 |
+
"output_hidden_states": false,
|
| 125 |
+
"return_dict": true,
|
| 126 |
+
"dtype": null,
|
| 127 |
+
"chunk_size_feed_forward": 0,
|
| 128 |
+
"is_encoder_decoder": false,
|
| 129 |
+
"id2label": {
|
| 130 |
+
"0": "LABEL_0",
|
| 131 |
+
"1": "LABEL_1"
|
| 132 |
+
},
|
| 133 |
+
"label2id": {
|
| 134 |
+
"LABEL_0": 0,
|
| 135 |
+
"LABEL_1": 1
|
| 136 |
+
},
|
| 137 |
+
"problem_type": null,
|
| 138 |
+
"vocab_size": 1,
|
| 139 |
+
"hidden_size": 1024,
|
| 140 |
+
"intermediate_size": 2816,
|
| 141 |
+
"num_hidden_layers": 3,
|
| 142 |
+
"num_attention_heads": 32,
|
| 143 |
+
"num_key_value_heads": 8,
|
| 144 |
+
"max_position_embeddings": 12,
|
| 145 |
+
"initializer_range": 0.02,
|
| 146 |
+
"norm_eps": 1e-05,
|
| 147 |
+
"use_cache": false,
|
| 148 |
+
"pad_token_id": null,
|
| 149 |
+
"bos_token_id": null,
|
| 150 |
+
"eos_token_id": null,
|
| 151 |
+
"tie_word_embeddings": true,
|
| 152 |
+
"rope_parameters": {
|
| 153 |
+
"full_attention": {
|
| 154 |
+
"rope_type": "default",
|
| 155 |
+
"rope_theta": 1000000.0,
|
| 156 |
+
"partial_rotary_factor": 1.0
|
| 157 |
+
}
|
| 158 |
+
},
|
| 159 |
+
"conv_bias": false,
|
| 160 |
+
"conv_L_cache": 7,
|
| 161 |
+
"layer_types": [
|
| 162 |
+
"full_attention",
|
| 163 |
+
"full_attention",
|
| 164 |
+
"full_attention"
|
| 165 |
+
],
|
| 166 |
+
"head_dim": 32,
|
| 167 |
+
"sliding_window": 256,
|
| 168 |
+
"use_sandwich_norm": false,
|
| 169 |
+
"_name_or_path": "",
|
| 170 |
+
"is_causal": false,
|
| 171 |
+
"model_type": "lfm3",
|
| 172 |
+
"output_attentions": false
|
| 173 |
+
},
|
| 174 |
+
"lfm": {
|
| 175 |
+
"transformers_version": "5.19.0.dev0",
|
| 176 |
+
"architectures": [
|
| 177 |
+
"Lfm3ForCausalLM"
|
| 178 |
+
],
|
| 179 |
+
"output_hidden_states": false,
|
| 180 |
+
"return_dict": true,
|
| 181 |
+
"dtype": "float32",
|
| 182 |
+
"chunk_size_feed_forward": 0,
|
| 183 |
+
"is_encoder_decoder": false,
|
| 184 |
+
"id2label": {
|
| 185 |
+
"0": "LABEL_0",
|
| 186 |
+
"1": "LABEL_1"
|
| 187 |
+
},
|
| 188 |
+
"label2id": {
|
| 189 |
+
"LABEL_0": 0,
|
| 190 |
+
"LABEL_1": 1
|
| 191 |
+
},
|
| 192 |
+
"problem_type": null,
|
| 193 |
+
"vocab_size": 128000,
|
| 194 |
+
"hidden_size": 2048,
|
| 195 |
+
"intermediate_size": 7680,
|
| 196 |
+
"num_hidden_layers": 24,
|
| 197 |
+
"num_attention_heads": 16,
|
| 198 |
+
"num_key_value_heads": 4,
|
| 199 |
+
"max_position_embeddings": 128000,
|
| 200 |
+
"initializer_range": 0.02,
|
| 201 |
+
"norm_eps": 1e-05,
|
| 202 |
+
"use_cache": true,
|
| 203 |
+
"pad_token_id": 124893,
|
| 204 |
+
"bos_token_id": 124894,
|
| 205 |
+
"eos_token_id": 124900,
|
| 206 |
+
"tie_word_embeddings": true,
|
| 207 |
+
"rope_parameters": {
|
| 208 |
+
"full_attention": {
|
| 209 |
+
"partial_rotary_factor": 0.5,
|
| 210 |
+
"rope_theta": 1000000.0,
|
| 211 |
+
"rope_type": "default"
|
| 212 |
+
},
|
| 213 |
+
"sliding_attention": {
|
| 214 |
+
"rope_theta": 10000,
|
| 215 |
+
"rope_type": "default"
|
| 216 |
+
}
|
| 217 |
+
},
|
| 218 |
+
"conv_bias": false,
|
| 219 |
+
"conv_L_cache": 7,
|
| 220 |
+
"layer_types": [
|
| 221 |
+
"conv",
|
| 222 |
+
"conv",
|
| 223 |
+
"full_attention",
|
| 224 |
+
"conv",
|
| 225 |
+
"sliding_attention",
|
| 226 |
+
"conv",
|
| 227 |
+
"full_attention",
|
| 228 |
+
"conv",
|
| 229 |
+
"sliding_attention",
|
| 230 |
+
"conv",
|
| 231 |
+
"full_attention",
|
| 232 |
+
"conv",
|
| 233 |
+
"sliding_attention",
|
| 234 |
+
"conv",
|
| 235 |
+
"full_attention",
|
| 236 |
+
"conv",
|
| 237 |
+
"sliding_attention",
|
| 238 |
+
"conv",
|
| 239 |
+
"full_attention",
|
| 240 |
+
"conv",
|
| 241 |
+
"sliding_attention",
|
| 242 |
+
"conv",
|
| 243 |
+
"full_attention",
|
| 244 |
+
"conv"
|
| 245 |
+
],
|
| 246 |
+
"head_dim": 128,
|
| 247 |
+
"sliding_window": 256,
|
| 248 |
+
"use_sandwich_norm": true,
|
| 249 |
+
"model_type": "lfm3",
|
| 250 |
+
"output_attentions": false
|
| 251 |
+
},
|
| 252 |
+
"auto_map": {
|
| 253 |
+
"AutoConfig": "configuration_lfm3_audio.Lfm3AudioConfig",
|
| 254 |
+
"AutoModel": "modeling_lfm3_audio.Lfm3AudioModel",
|
| 255 |
+
"AutoModelForMultimodalLM": "modeling_lfm3_audio.Lfm3AudioForConditionalGeneration",
|
| 256 |
+
"AutoModelForSeq2SeqLM": "modeling_lfm3_audio.Lfm3AudioForConditionalGeneration"
|
| 257 |
+
},
|
| 258 |
"audio_config": {
|
| 259 |
"attention_bias": false,
|
| 260 |
"attention_dropout": 0.0,
|
|
|
|
| 345 |
},
|
| 346 |
"dtype": "bfloat16",
|
| 347 |
"initializer_range": 0.02,
|
|
|
|
|
|
|
| 348 |
"maskgit_schedule": [
|
| 349 |
4,
|
| 350 |
4,
|
|
|
|
| 352 |
],
|
| 353 |
"mixed_end_token_id": 125016,
|
| 354 |
"mixed_start_token_id": 125015,
|
|
|
|
| 355 |
"num_codebooks": 12,
|
| 356 |
"projector_hidden_act": "gelu",
|
| 357 |
"text_config": {
|
generation_config.json
CHANGED
|
@@ -1,18 +1,28 @@
|
|
| 1 |
{
|
| 2 |
"bos_token_id": 124894,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"depth_decoder_do_sample": true,
|
| 4 |
"depth_decoder_repetition_penalty": 1.1,
|
| 5 |
"depth_decoder_repetition_window": 4096,
|
| 6 |
"depth_decoder_temperature": 1.0,
|
| 7 |
"depth_decoder_top_k": 128,
|
| 8 |
-
"do_sample": false,
|
| 9 |
-
"eos_token_id": [
|
| 10 |
-
124900,
|
| 11 |
-
125014
|
| 12 |
-
],
|
| 13 |
"max_new_tokens_last_audio_chunk": 96,
|
| 14 |
"max_new_tokens_per_audio_chunk": 48,
|
| 15 |
-
"pad_token_id": 124893,
|
| 16 |
"return_dict_in_generate": true,
|
| 17 |
"transformers_version": "5.23.0.dev0",
|
| 18 |
"suppress_tokens": [
|
|
|
|
| 1 |
{
|
| 2 |
"bos_token_id": 124894,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
124900,
|
| 5 |
+
125014
|
| 6 |
+
],
|
| 7 |
+
"pad_token_id": 124893,
|
| 8 |
+
"use_cache": true,
|
| 9 |
+
"output_attentions": false,
|
| 10 |
+
"output_hidden_states": false,
|
| 11 |
+
"do_sample": false,
|
| 12 |
+
"repetition_penalty": 1.0,
|
| 13 |
+
"temperature": 0.0,
|
| 14 |
+
"top_k": 1,
|
| 15 |
+
"audio_temperature": 1.0,
|
| 16 |
+
"audio_top_k": 128,
|
| 17 |
+
"audio_repetition_penalty": 1.1,
|
| 18 |
+
"audio_repetition_window": 4096,
|
| 19 |
"depth_decoder_do_sample": true,
|
| 20 |
"depth_decoder_repetition_penalty": 1.1,
|
| 21 |
"depth_decoder_repetition_window": 4096,
|
| 22 |
"depth_decoder_temperature": 1.0,
|
| 23 |
"depth_decoder_top_k": 128,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
"max_new_tokens_last_audio_chunk": 96,
|
| 25 |
"max_new_tokens_per_audio_chunk": 48,
|
|
|
|
| 26 |
"return_dict_in_generate": true,
|
| 27 |
"transformers_version": "5.23.0.dev0",
|
| 28 |
"suppress_tokens": [
|