ntt123 commited on
Commit
04a69d4
1 Parent(s): 21f3d42
app.py CHANGED
@@ -7,16 +7,17 @@
7
  import os
8
  import re
9
  import unicodedata
 
10
  import regex
11
 
12
  if not os.path.isfile("./wavegru_mod.so"):
13
  os.system("bash ./build_ext.sh")
14
 
15
  import gradio as gr
 
16
  from inference import load_tacotron_model, load_wavegru_net, mel_to_wav, text_to_mel
17
  from wavegru_cpp import extract_weight_mask, load_wavegru_cpp
18
 
19
-
20
  alphabet, tacotron_net, tacotron_config = load_tacotron_model(
21
  "./alphabet.txt", "./tacotron.toml", "./mono_tts_cbhg_small_0700000.ckpt"
22
  )
@@ -26,9 +27,7 @@ wavegru_config, wavegru_net = load_wavegru_net(
26
  )
27
 
28
  wave_cpp_weight_mask = extract_weight_mask(wavegru_net)
29
- wavecpp = load_wavegru_cpp(
30
- wave_cpp_weight_mask, wavegru_config["upsample_factors"][-1]
31
- )
32
 
33
 
34
  space_re = regex.compile(r"\s+")
 
7
  import os
8
  import re
9
  import unicodedata
10
+
11
  import regex
12
 
13
  if not os.path.isfile("./wavegru_mod.so"):
14
  os.system("bash ./build_ext.sh")
15
 
16
  import gradio as gr
17
+
18
  from inference import load_tacotron_model, load_wavegru_net, mel_to_wav, text_to_mel
19
  from wavegru_cpp import extract_weight_mask, load_wavegru_cpp
20
 
 
21
  alphabet, tacotron_net, tacotron_config = load_tacotron_model(
22
  "./alphabet.txt", "./tacotron.toml", "./mono_tts_cbhg_small_0700000.ckpt"
23
  )
 
27
  )
28
 
29
  wave_cpp_weight_mask = extract_weight_mask(wavegru_net)
30
+ wavecpp = load_wavegru_cpp(wave_cpp_weight_mask, wavegru_config["upsample_factors"][-1])
 
 
31
 
32
 
33
  space_re = regex.compile(r"\s+")
extract_tacotrons_model.py CHANGED
@@ -1,5 +1,8 @@
1
  import pickle
2
 
 
 
3
  dic = pickle.load(open("./mono_tts_cbhg_small_0700000.ckpt", "rb"))
4
  del dic["optim_state_dict"]
 
5
  pickle.dump(dic, open("./mono_tts_cbhg_small_0700000.ckpt", "wb"))
 
1
  import pickle
2
 
3
+ import jax
4
+
5
  dic = pickle.load(open("./mono_tts_cbhg_small_0700000.ckpt", "rb"))
6
  del dic["optim_state_dict"]
7
+ dic = jax.device_get(dic)
8
  pickle.dump(dic, open("./mono_tts_cbhg_small_0700000.ckpt", "wb"))
extract_wavegru_model.py CHANGED
@@ -1,5 +1,12 @@
1
  import pickle
2
 
3
- dic = pickle.load(open("./wavegru_vocoder_tpu_gta_preemphasis_pruning_0800000.ckpt", "rb"))
 
 
 
 
 
4
  del dic["optim_state_dict"]
5
- pickle.dump(dic, open("./wavegru_vocoder_tpu_gta_preemphasis_pruning_0800000.ckpt", "wb"))
 
 
 
1
  import pickle
2
 
3
+ import jax
4
+
5
+ dic = pickle.load(
6
+ open("./wavegru_vocoder_tpu_gta_preemphasis_pruning_0800000.ckpt", "rb")
7
+ )
8
+ dic = jax.device_get(dic)
9
  del dic["optim_state_dict"]
10
+ pickle.dump(
11
+ dic, open("./wavegru_vocoder_tpu_gta_preemphasis_pruning_0800000.ckpt", "wb")
12
+ )
mynumbers.py CHANGED
@@ -1,8 +1,8 @@
1
  """ from https://github.com/keithito/tacotron """
2
 
3
- import inflect
4
  import re
5
 
 
6
 
7
  _inflect = inflect.engine()
8
  _comma_number_re = re.compile(r"([0-9][0-9\,]+[0-9])")
 
1
  """ from https://github.com/keithito/tacotron """
2
 
 
3
  import re
4
 
5
+ import inflect
6
 
7
  _inflect = inflect.engine()
8
  _comma_number_re = re.compile(r"([0-9][0-9\,]+[0-9])")
wavegru_vocoder_tpu_gta_preemphasis_pruning_0800000.ckpt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:17d7801c9aaa72992671be5066953ae9598ee91ecfeb502a88e2fd27aac19cc6
3
- size 69718512
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1225b31bfc3a79ae4f0884c559b4698b3ea6b33a70b589883bf0bc76e23fb467
3
+ size 69717656