biubiu2 commited on
Commit
193f36a
·
verified ·
1 Parent(s): 1934071

Add files using upload-large-folder tool

Browse files
Files changed (4) hide show
  1. README.md +121 -0
  2. config.json +49 -0
  3. model.safetensors +3 -0
  4. preprocessor_config.json +10 -0
README.md ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ library_name: transformers
4
+ tags:
5
+ - mimi
6
+ - audio
7
+ ---
8
+
9
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62611fcabbcbd1c34f1615f6/QPpyznxSH5CxjJ_mA0rdg.png)
10
+
11
+ # Model Card for Mimi
12
+
13
+ Mimi codec is a state-of-the-art audio neural codec, developped by [Kyutai](https://kyutai.org/), that combines semantic and acoustic information into audio tokens running at 12.5Hz and a bitrate of 1.1kbps.
14
+
15
+ ## Model Details
16
+
17
+ ### Model Description
18
+
19
+ Mimi is a high-fidelity audio codec leveraging neural networks. It introduces a streaming encoder-decoder architecture with quantized latent space, trained in an end-to-end fashion.
20
+
21
+ It was trained on speech data, which makes it particularly adapted to train speech language models or text-to-speech systems.
22
+
23
+ - **Developed by:** Kyutai
24
+ - **Model type:** Audio codec
25
+ - **Audio types:** Speech
26
+ - **License:** CC-BY
27
+
28
+ ### Model Sources
29
+
30
+
31
+ - **Repository:** [repo](https://github.com/kyutai-labs/moshi)
32
+ - **Paper:** [paper](http://kyutai.org/Moshi.pdf)
33
+ - **Demo:** [demo](https://moshi.chat/)
34
+
35
+ ## Uses
36
+
37
+
38
+ ## How to Get Started with the Model
39
+
40
+ ### Usage with `transformers`
41
+
42
+ Use the following code to get started with the Mimi model using a dummy example from the LibriSpeech dataset (~9MB). First, install the required Python packages:
43
+
44
+ ```
45
+ pip install --upgrade pip
46
+ pip install --upgrade datasets[audio]
47
+ pip install git+https://github.com/huggingface/transformers.git@main
48
+ ```
49
+
50
+ Then load an audio sample, and run a forward pass of the model:
51
+
52
+ ```python
53
+ from datasets import load_dataset, Audio
54
+ from transformers import MimiModel, AutoFeatureExtractor
55
+
56
+ # load a demonstration datasets
57
+ librispeech_dummy = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
58
+
59
+ # load the model + feature extractor (for pre-processing the audio)
60
+ model = MimiModel.from_pretrained("kyutai/mimi")
61
+ feature_extractor = AutoFeatureExtractor.from_pretrained("kyutai/mimi")
62
+
63
+ # cast the audio data to the correct sampling rate for the model
64
+ librispeech_dummy = librispeech_dummy.cast_column("audio", Audio(sampling_rate=feature_extractor.sampling_rate))
65
+ audio_sample = librispeech_dummy[0]["audio"]["array"]
66
+
67
+ # pre-process the inputs
68
+ inputs = feature_extractor(raw_audio=audio_sample, sampling_rate=feature_extractor.sampling_rate, return_tensors="pt")
69
+
70
+ # explicitly encode then decode the audio inputs
71
+ encoder_outputs = model.encode(inputs["input_values"])
72
+ audio_values = model.decode(encoder_outputs.audio_codes)[0]
73
+
74
+ # or the equivalent with a forward pass
75
+ audio_values = model(inputs["input_values"]).audio_values
76
+ ```
77
+
78
+ ### Usage with Moshi
79
+
80
+ See the main [README](https://github.com/kyutai-labs/moshi) file.
81
+
82
+ ### Direct Use
83
+
84
+ Mimi can be used directly as an audio codec for real-time compression and decompression of speech signals.
85
+ It provides high-quality audio compression and efficient decoding.
86
+
87
+ ### Out-of-Scope Use
88
+
89
+ The model is not intended to be used to impersonate other people or any malicious use of any kind.
90
+
91
+ ## Bias, Risks, and Limitations
92
+
93
+ The model has been trained with a few safeguards to try to limit potential toxic usages, however our toxicity analysis shows that it behaves in the middle of existing models with respect to textual generation. It has some bias towards certain domains and topics that are over-represented in the training data. Its capabilities are relatively limited so far and it is trained to produce only one voice to avoid impersonation. Yet, we need the perspective in time to establish the sociotechnical limitations.
94
+
95
+
96
+ ## Training Details
97
+
98
+ ### Training Data
99
+
100
+ The training data is detailled in the paper.
101
+
102
+ ### Training procedure and hyper-parameters
103
+
104
+ The different stages of the training procedure are detailled in the paper along with the hyper-parameters.
105
+
106
+ ## Citation
107
+
108
+ ```
109
+ @techreport{kyutai2024moshi,
110
+ author = {Alexandre D\'efossez and Laurent Mazar\'e and Manu Orsini and Am\'elie Royer and Patrick P\'erez and Herv\'e J\'egou and Edouard Grave and Neil Zeghidour},
111
+ title = {Moshi: a speech-text foundation model for real-time dialogue},
112
+ institution = {Kyutai},
113
+ year={2024},
114
+ month={September},
115
+ url={http://kyutai.org/Moshi.pdf},
116
+ }
117
+ ```
118
+
119
+ ## Model Card Authors
120
+
121
+ Alexandre Défossez, Laurent Mazaré, Manu Orsini, Amélie Royer, Patrick Pérez, Hervé Jégou, Edouard Grave, Neil Zeghidour, Yoach Lacombe
config.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MimiModel"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "audio_channels": 1,
7
+ "codebook_dim": 256,
8
+ "codebook_size": 2048,
9
+ "compress": 2,
10
+ "dilation_growth_rate": 2,
11
+ "frame_rate": 12.5,
12
+ "head_dim": 64,
13
+ "hidden_act": "gelu",
14
+ "hidden_size": 512,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 2048,
17
+ "kernel_size": 7,
18
+ "last_kernel_size": 3,
19
+ "layer_scale_initial_scale": 0.01,
20
+ "max_position_embeddings": 8000,
21
+ "model_type": "mimi",
22
+ "norm_eps": 1e-05,
23
+ "normalize": false,
24
+ "num_attention_heads": 8,
25
+ "num_filters": 64,
26
+ "num_hidden_layers": 8,
27
+ "num_key_value_heads": 8,
28
+ "num_residual_layers": 1,
29
+ "num_semantic_quantizers": 1,
30
+ "pad_mode": "constant",
31
+ "residual_kernel_size": 3,
32
+ "rope_theta": 10000.0,
33
+ "sampling_rate": 24000,
34
+ "sliding_window": 250,
35
+ "torch_dtype": "float32",
36
+ "transformers_version": "4.45.0.dev0",
37
+ "trim_right_ratio": 1.0,
38
+ "upsample_groups": 512,
39
+ "upsampling_ratios": [
40
+ 8,
41
+ 6,
42
+ 5,
43
+ 4
44
+ ],
45
+ "use_cache": false,
46
+ "use_causal_conv": true,
47
+ "use_conv_shortcut": false,
48
+ "vector_quantization_hidden_dimension": 256
49
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bac7e85083dcded655d24eaadde7e6eea34c0da1b35fa2d284e641bd2b942a5e
3
+ size 384649828
preprocessor_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "chunk_length_s": null,
3
+ "feature_extractor_type": "EncodecFeatureExtractor",
4
+ "feature_size": 1,
5
+ "overlap": null,
6
+ "padding_side": "right",
7
+ "padding_value": 0.0,
8
+ "return_attention_mask": true,
9
+ "sampling_rate": 24000
10
+ }