yky-h commited on
Commit
dba803e
·
verified ·
1 Parent(s): 741c615

upload model

Browse files
README.md ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: ja
3
+ license: apache-2.0
4
+ datasets: reazon-research/reazonspeech
5
+ pipeline_tag: feature-extraction
6
+ inference: false
7
+ tags:
8
+ - speech
9
+ ---
10
+
11
+ # Japanese data2vec Audio Base
12
+
13
+ This is a mirror of [japanese-data2vec-audio-base](https://huggingface.co/rinna/japanese-data2vec-audio-base), originally released by rinna Co., Ltd.
14
+ The original model is licensed under the Apache License 2.0.
15
+ This mirror follows the same license terms.
16
+ All copyrights remain with the original authors.
17
+
18
+ ---
19
+
20
+ # Overview
21
+
22
+ This is a Japanese data2vec Audio Base model trained by [rinna Co., Ltd.](https://rinna.co.jp/)
23
+
24
+ * **Model summary**
25
+
26
+ The model architecture is the same as the [original data2vec Audio Base model](https://huggingface.co/facebook/data2vec-audio-base), which contains 12 transformer layers with 12 attention heads.
27
+ The model was trained using code from the [official repository](https://github.com/facebookresearch/fairseq/tree/main/examples/data2vec#data2vec), and the detailed training configuration can be found in the same repository and the [original paper](https://ai.meta.com/research/data2vec-a-general-framework-for-self-supervised-learning-in-speech-vision-and-language/).
28
+
29
+
30
+ * **Training**
31
+
32
+ The model was trained on approximately 19,000 hours of following Japanese speech corpus ReazonSpeech v1.
33
+ - [ReazonSpeech](https://huggingface.co/datasets/reazon-research/reazonspeech)
34
+
35
+ * **Contributors**
36
+
37
+ - [Yukiya Hono](https://huggingface.co/yky-h)
38
+ - [Kentaro Mitsui](https://huggingface.co/Kentaro321)
39
+ - [Kei Sawada](https://huggingface.co/keisawada)
40
+
41
+ * **Release date**
42
+
43
+ March 7, 2024
44
+
45
+ ---
46
+
47
+ # How to use the model
48
+
49
+ ```python
50
+ import soundfile as sf
51
+ from transformers import AutoFeatureExtractor, AutoModel
52
+
53
+ model_name = "yky-h/japanese-data2vec-audio-base"
54
+ feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
55
+ model = AutoModel.from_pretrained(model_name)
56
+ model.eval()
57
+
58
+ raw_speech_16kHz, sr = sf.read(audio_file)
59
+ inputs = feature_extractor(
60
+ raw_speech_16kHz,
61
+ return_tensors="pt",
62
+ sampling_rate=sr,
63
+ )
64
+ outputs = model(**inputs)
65
+
66
+ print(f"Input: {inputs.input_values.size()}") # [1, #samples]
67
+ print(f"Output: {outputs.last_hidden_state.size()}") # [1, #frames, 768]
68
+ ```
69
+
70
+ A fairseq checkpoint file can also be available [here](https://huggingface.co/yky-h/japanese-data2vec-audio-base/tree/main/fairseq).
71
+
72
+ ---
73
+
74
+ # How to cite
75
+ ```bibtex
76
+ @misc{rinna-japanese-data2vec-audio-base,
77
+ title = {rinna/japanese-data2vec-audio-base},
78
+ author = {Hono, Yukiya and Mitsui, Kentaro and Sawada, Kei},
79
+ url = {https://huggingface.co/rinna/japanese-data2vec-audio-base}
80
+ }
81
+
82
+ @inproceedings{sawada2024release,
83
+ title = {Release of Pre-Trained Models for the {J}apanese Language},
84
+ author = {Sawada, Kei and Zhao, Tianyu and Shing, Makoto and Mitsui, Kentaro and Kaga, Akio and Hono, Yukiya and Wakatsuki, Toshiaki and Mitsuda, Koh},
85
+ booktitle = {Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
86
+ month = {5},
87
+ year = {2024},
88
+ pages = {13898--13905},
89
+ url = {https://aclanthology.org/2024.lrec-main.1213},
90
+ note = {\url{https://arxiv.org/abs/2404.01657}}
91
+ }
92
+ ```
93
+
94
+ ---
95
+
96
+ # References
97
+ ```bibtex
98
+ @inproceedings{baevski2022data2vec,
99
+ title={Data2vec: A general framework for self-supervised learning in speech, vision and language},
100
+ author={Baevski, Alexei and Hsu, Wei-Ning and Xu, Qiantong and Babu, Arun and Gu, Jiatao and Auli, Michael},
101
+ booktitle={International Conference on Machine Learning},
102
+ year={2022},
103
+ pages={1298--1312},
104
+ doi={10.48550/arXiv.2202.03555}
105
+ }
106
+ ```
107
+
108
+ ---
109
+
110
+ # License
111
+ [The Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0)
config.json ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "rinna/japanese-data2vec-base",
3
+ "activation_dropout": 0.1,
4
+ "adapter_kernel_size": 3,
5
+ "adapter_stride": 2,
6
+ "add_adapter": false,
7
+ "architectures": [
8
+ "Data2VecAudioModel"
9
+ ],
10
+ "attention_dropout": 0.1,
11
+ "bos_token_id": 1,
12
+ "classifier_proj_size": 256,
13
+ "conv_bias": false,
14
+ "conv_dim": [
15
+ 512,
16
+ 512,
17
+ 512,
18
+ 512,
19
+ 512,
20
+ 512,
21
+ 512
22
+ ],
23
+ "conv_kernel": [
24
+ 10,
25
+ 3,
26
+ 3,
27
+ 3,
28
+ 3,
29
+ 2,
30
+ 2
31
+ ],
32
+ "conv_pos_kernel_size": 19,
33
+ "conv_stride": [
34
+ 5,
35
+ 2,
36
+ 2,
37
+ 2,
38
+ 2,
39
+ 2,
40
+ 2
41
+ ],
42
+ "ctc_loss_reduction": "sum",
43
+ "ctc_zero_infinity": false,
44
+ "eos_token_id": 2,
45
+ "feat_extract_activation": "gelu",
46
+ "feat_proj_dropout": 0.0,
47
+ "final_dropout": 0.1,
48
+ "hidden_act": "gelu",
49
+ "hidden_dropout": 0.1,
50
+ "hidden_size": 768,
51
+ "initializer_range": 0.02,
52
+ "intermediate_size": 3072,
53
+ "layer_norm_eps": 1e-05,
54
+ "layerdrop": 0.1,
55
+ "mask_feature_length": 10,
56
+ "mask_feature_min_masks": 0,
57
+ "mask_feature_prob": 0.0,
58
+ "mask_time_length": 10,
59
+ "mask_time_min_masks": 2,
60
+ "mask_time_prob": 0.05,
61
+ "model_type": "data2vec-audio",
62
+ "num_adapter_layers": 3,
63
+ "num_attention_heads": 12,
64
+ "num_conv_pos_embedding_groups": 16,
65
+ "num_conv_pos_embeddings": 5,
66
+ "num_feat_extract_layers": 7,
67
+ "num_hidden_layers": 12,
68
+ "output_hidden_size": 768,
69
+ "pad_token_id": 0,
70
+ "tdnn_dilation": [
71
+ 1,
72
+ 2,
73
+ 3,
74
+ 1,
75
+ 1
76
+ ],
77
+ "tdnn_dim": [
78
+ 512,
79
+ 512,
80
+ 512,
81
+ 512,
82
+ 1500
83
+ ],
84
+ "tdnn_kernel": [
85
+ 5,
86
+ 3,
87
+ 3,
88
+ 1,
89
+ 1
90
+ ],
91
+ "torch_dtype": "float32",
92
+ "transformers_version": "4.28.1",
93
+ "use_weighted_layer_sum": false,
94
+ "vocab_size": 32,
95
+ "xvector_output_dim": 512
96
+ }
fairseq/model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ca2fad0e75704d7d293f0cb2ddcd87603550e0aa5078c4736ea7b0bf4f1d63d
3
+ size 729428441
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a86b908130d6e7e87b5b32ca35c81a64c520a3c7538976cb42f94b5df374e272
3
+ size 372683128
preprocessor_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "feature_extractor_type": "Wav2Vec2FeatureExtractor",
4
+ "feature_size": 1,
5
+ "padding_side": "right",
6
+ "padding_value": 0.0,
7
+ "return_attention_mask": true,
8
+ "sampling_rate": 16000
9
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e06d84bb424ca9ca5b11d82348fd04b7c02d60a4a128694c4f4800ecb1ed908
3
+ size 372731429