dcjack commited on
Commit
5019233
·
verified ·
1 Parent(s): d1485fb

initial upload

Browse files
Files changed (5) hide show
  1. README.md +76 -3
  2. config.yml +60 -0
  3. gitattributes +16 -0
  4. model.h5 +3 -0
  5. processor.json +1 -0
README.md CHANGED
@@ -1,3 +1,76 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - tensorflowtts
4
+ - audio
5
+ - text-to-speech
6
+ - text-to-mel
7
+ language: eng
8
+ license: apache-2.0
9
+ datasets:
10
+ - LJSpeech
11
+ widget:
12
+ - text: "How are you?"
13
+ ---
14
+
15
+ # FastSpeech2 trained on LJSpeech (Eng)
16
+ This repository provides a pretrained [FastSpeech2](https://arxiv.org/abs/2006.04558) trained on LJSpeech dataset (ENG). For a detail of the model, we encourage you to read more about
17
+ [TensorFlowTTS](https://github.com/TensorSpeech/TensorFlowTTS).
18
+
19
+
20
+ ## Install TensorFlowTTS
21
+ First of all, please install TensorFlowTTS with the following command:
22
+ ```
23
+ pip install TensorFlowTTS
24
+ ```
25
+
26
+ ### Converting your Text to Mel Spectrogram
27
+ ```python
28
+ import numpy as np
29
+ import soundfile as sf
30
+ import yaml
31
+
32
+ import tensorflow as tf
33
+
34
+ from tensorflow_tts.inference import AutoProcessor
35
+ from tensorflow_tts.inference import TFAutoModel
36
+
37
+ processor = AutoProcessor.from_pretrained("tensorspeech/tts-fastspeech2-ljspeech-en")
38
+ fastspeech2 = TFAutoModel.from_pretrained("tensorspeech/tts-fastspeech2-ljspeech-en")
39
+
40
+ text = "How are you?"
41
+
42
+ input_ids = processor.text_to_sequence(text)
43
+
44
+ mel_before, mel_after, duration_outputs, _, _ = fastspeech2.inference(
45
+ input_ids=tf.expand_dims(tf.convert_to_tensor(input_ids, dtype=tf.int32), 0),
46
+ speaker_ids=tf.convert_to_tensor([0], dtype=tf.int32),
47
+ speed_ratios=tf.convert_to_tensor([1.0], dtype=tf.float32),
48
+ f0_ratios =tf.convert_to_tensor([1.0], dtype=tf.float32),
49
+ energy_ratios =tf.convert_to_tensor([1.0], dtype=tf.float32),
50
+ )
51
+ ```
52
+
53
+ #### Referencing FastSpeech2
54
+ ```
55
+ @misc{ren2021fastspeech,
56
+ title={FastSpeech 2: Fast and High-Quality End-to-End Text to Speech},
57
+ author={Yi Ren and Chenxu Hu and Xu Tan and Tao Qin and Sheng Zhao and Zhou Zhao and Tie-Yan Liu},
58
+ year={2021},
59
+ eprint={2006.04558},
60
+ archivePrefix={arXiv},
61
+ primaryClass={eess.AS}
62
+ }
63
+ ```
64
+
65
+ #### Referencing TensorFlowTTS
66
+ ```
67
+ @misc{TFTTS,
68
+ author = {Minh Nguyen, Alejandro Miguel Velasquez, Erogol, Kuan Chen, Dawid Kobus, Takuya Ebata,
69
+ Trinh Le and Yunchao He},
70
+ title = {TensorflowTTS},
71
+ year = {2020},
72
+ publisher = {GitHub},
73
+ journal = {GitHub repository},
74
+ howpublished = {\\url{https://github.com/TensorSpeech/TensorFlowTTS}},
75
+ }
76
+ ```
config.yml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ allow_cache: true
2
+ batch_size: 1
3
+ config: ./examples/fastspeech2/conf/fastspeech2.v1.yaml
4
+ dev_dir: /home/kuone/TTS/dump_ljspeech/valid/
5
+ energy_stat: /home/kuone/TTS/dump_ljspeech/stats_energy.npy
6
+ eval_interval_steps: 500
7
+ f0_stat: /home/kuone/TTS/dump_ljspeech/stats_f0.npy
8
+ fastspeech2_params:
9
+ attention_probs_dropout_prob: 0.1
10
+ decoder_attention_head_size: 192
11
+ decoder_hidden_act: mish
12
+ decoder_hidden_size: 384
13
+ decoder_intermediate_kernel_size: 3
14
+ decoder_intermediate_size: 1024
15
+ decoder_num_attention_heads: 2
16
+ decoder_num_hidden_layers: 4
17
+ encoder_attention_head_size: 192
18
+ encoder_hidden_act: mish
19
+ encoder_hidden_size: 384
20
+ encoder_intermediate_kernel_size: 3
21
+ encoder_intermediate_size: 1024
22
+ encoder_num_attention_heads: 2
23
+ encoder_num_hidden_layers: 4
24
+ hidden_dropout_prob: 0.2
25
+ initializer_range: 0.02
26
+ max_position_embeddings: 2048
27
+ n_speakers: 1
28
+ num_mels: 80
29
+ output_attentions: false
30
+ output_hidden_states: false
31
+ variant_prediction_num_conv_layers: 2
32
+ variant_predictor_dropout_rate: 0.5
33
+ variant_predictor_filter: 256
34
+ variant_predictor_kernel_size: 3
35
+ format: npy
36
+ gradient_accumulation_steps: 1
37
+ hop_size: 256
38
+ is_shuffle: true
39
+ log_interval_steps: 200
40
+ mel_length_threshold: 32
41
+ mixed_precision: true
42
+ model_type: fastspeech2
43
+ num_save_intermediate_results: 1
44
+ optimizer_params:
45
+ decay_steps: 150000
46
+ end_learning_rate: 5.0e-05
47
+ initial_learning_rate: 0.001
48
+ warmup_proportion: 0.02
49
+ weight_decay: 0.001
50
+ outdir: ./examples/fastspeech2/exp/train.fastspeech2.v1/
51
+ pretrained: ''
52
+ remove_short_samples: true
53
+ resume: ''
54
+ save_interval_steps: 5000
55
+ train_dir: /home/kuone/TTS/dump_ljspeech/train/
56
+ train_max_steps: 40000
57
+ use_norm: true
58
+ var_train_expr: null
59
+ verbose: 1
60
+ version: '0.0'
gitattributes ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
2
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.h5 filter=lfs diff=lfs merge=lfs -text
5
+ *.tflite filter=lfs diff=lfs merge=lfs -text
6
+ *.tar.gz filter=lfs diff=lfs merge=lfs -text
7
+ *.ot filter=lfs diff=lfs merge=lfs -text
8
+ *.onnx filter=lfs diff=lfs merge=lfs -text
9
+ *.arrow filter=lfs diff=lfs merge=lfs -text
10
+ *.ftz filter=lfs diff=lfs merge=lfs -text
11
+ *.joblib filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.pb filter=lfs diff=lfs merge=lfs -text
15
+ *.pt filter=lfs diff=lfs merge=lfs -text
16
+ *.pth filter=lfs diff=lfs merge=lfs -text
model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc801cff5dce73a944f2e9b5f17de6351d3b7b629bd1124bcd87bbde7305f8b4
3
+ size 124799600
processor.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"symbol_to_id": {"pad": 0, "-": 1, "!": 2, "'": 3, "(": 4, ")": 5, ",": 6, ".": 7, ":": 8, ";": 9, "?": 10, " ": 11, "A": 12, "B": 13, "C": 14, "D": 15, "E": 16, "F": 17, "G": 18, "H": 19, "I": 20, "J": 21, "K": 22, "L": 23, "M": 24, "N": 25, "O": 26, "P": 27, "Q": 28, "R": 29, "S": 30, "T": 31, "U": 32, "V": 33, "W": 34, "X": 35, "Y": 36, "Z": 37, "a": 38, "b": 39, "c": 40, "d": 41, "e": 42, "f": 43, "g": 44, "h": 45, "i": 46, "j": 47, "k": 48, "l": 49, "m": 50, "n": 51, "o": 52, "p": 53, "q": 54, "r": 55, "s": 56, "t": 57, "u": 58, "v": 59, "w": 60, "x": 61, "y": 62, "z": 63, "@AA": 64, "@AA0": 65, "@AA1": 66, "@AA2": 67, "@AE": 68, "@AE0": 69, "@AE1": 70, "@AE2": 71, "@AH": 72, "@AH0": 73, "@AH1": 74, "@AH2": 75, "@AO": 76, "@AO0": 77, "@AO1": 78, "@AO2": 79, "@AW": 80, "@AW0": 81, "@AW1": 82, "@AW2": 83, "@AY": 84, "@AY0": 85, "@AY1": 86, "@AY2": 87, "@B": 88, "@CH": 89, "@D": 90, "@DH": 91, "@EH": 92, "@EH0": 93, "@EH1": 94, "@EH2": 95, "@ER": 96, "@ER0": 97, "@ER1": 98, "@ER2": 99, "@EY": 100, "@EY0": 101, "@EY1": 102, "@EY2": 103, "@F": 104, "@G": 105, "@HH": 106, "@IH": 107, "@IH0": 108, "@IH1": 109, "@IH2": 110, "@IY": 111, "@IY0": 112, "@IY1": 113, "@IY2": 114, "@JH": 115, "@K": 116, "@L": 117, "@M": 118, "@N": 119, "@NG": 120, "@OW": 121, "@OW0": 122, "@OW1": 123, "@OW2": 124, "@OY": 125, "@OY0": 126, "@OY1": 127, "@OY2": 128, "@P": 129, "@R": 130, "@S": 131, "@SH": 132, "@T": 133, "@TH": 134, "@UH": 135, "@UH0": 136, "@UH1": 137, "@UH2": 138, "@UW": 139, "@UW0": 140, "@UW1": 141, "@UW2": 142, "@V": 143, "@W": 144, "@Y": 145, "@Z": 146, "@ZH": 147, "eos": 148}, "id_to_symbol": {"0": "pad", "1": "-", "2": "!", "3": "'", "4": "(", "5": ")", "6": ",", "7": ".", "8": ":", "9": ";", "10": "?", "11": " ", "12": "A", "13": "B", "14": "C", "15": "D", "16": "E", "17": "F", "18": "G", "19": "H", "20": "I", "21": "J", "22": "K", "23": "L", "24": "M", "25": "N", "26": "O", "27": "P", "28": "Q", "29": "R", "30": "S", "31": "T", "32": "U", "33": "V", "34": "W", "35": "X", "36": "Y", "37": "Z", "38": "a", "39": "b", "40": "c", "41": "d", "42": "e", "43": "f", "44": "g", "45": "h", "46": "i", "47": "j", "48": "k", "49": "l", "50": "m", "51": "n", "52": "o", "53": "p", "54": "q", "55": "r", "56": "s", "57": "t", "58": "u", "59": "v", "60": "w", "61": "x", "62": "y", "63": "z", "64": "@AA", "65": "@AA0", "66": "@AA1", "67": "@AA2", "68": "@AE", "69": "@AE0", "70": "@AE1", "71": "@AE2", "72": "@AH", "73": "@AH0", "74": "@AH1", "75": "@AH2", "76": "@AO", "77": "@AO0", "78": "@AO1", "79": "@AO2", "80": "@AW", "81": "@AW0", "82": "@AW1", "83": "@AW2", "84": "@AY", "85": "@AY0", "86": "@AY1", "87": "@AY2", "88": "@B", "89": "@CH", "90": "@D", "91": "@DH", "92": "@EH", "93": "@EH0", "94": "@EH1", "95": "@EH2", "96": "@ER", "97": "@ER0", "98": "@ER1", "99": "@ER2", "100": "@EY", "101": "@EY0", "102": "@EY1", "103": "@EY2", "104": "@F", "105": "@G", "106": "@HH", "107": "@IH", "108": "@IH0", "109": "@IH1", "110": "@IH2", "111": "@IY", "112": "@IY0", "113": "@IY1", "114": "@IY2", "115": "@JH", "116": "@K", "117": "@L", "118": "@M", "119": "@N", "120": "@NG", "121": "@OW", "122": "@OW0", "123": "@OW1", "124": "@OW2", "125": "@OY", "126": "@OY0", "127": "@OY1", "128": "@OY2", "129": "@P", "130": "@R", "131": "@S", "132": "@SH", "133": "@T", "134": "@TH", "135": "@UH", "136": "@UH0", "137": "@UH1", "138": "@UH2", "139": "@UW", "140": "@UW0", "141": "@UW1", "142": "@UW2", "143": "@V", "144": "@W", "145": "@Y", "146": "@Z", "147": "@ZH", "148": "eos"}, "speakers_map": {"ljspeech": 0}, "processor_name": "LJSpeechProcessor"}