NTT123 commited on
Commit
e4abdca
1 Parent(s): 0d4d10a

finalize the small model.

Browse files
Files changed (5) hide show
  1. README.md +7 -1
  2. inference.py +1 -1
  3. wavegru.ckpt +1 -1
  4. wavegru_mod.cc +12 -12
  5. wavegru_mod.so +1 -1
README.md CHANGED
@@ -10,4 +10,10 @@ pinned: false
10
  license: mit
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
 
 
 
 
 
 
 
10
  license: mit
11
  ---
12
 
13
+
14
+ ## Build wavenet-cpp
15
+
16
+
17
+ ./bazelisk-linux-amd64 build wavegru_mod -c opt --copt=-march=native
18
+ cp -f bazel-bin/wavegru_mod.so .
19
+
inference.py CHANGED
@@ -69,7 +69,7 @@ def mel_to_wav(net, netcpp, mel, config):
69
  mel = np.pad(mel, [(0, 0), (pad, pad), (0, 0)], mode="edge")
70
  ft = wavegru_inference(net, mel)
71
  ft = jax.device_get(ft[0])
72
- wav = netcpp.inference(ft, 1.0)
73
  wav = np.array(wav)
74
  wav = librosa.mu_expand(wav - 127, mu=255)
75
  wav = librosa.effects.deemphasis(wav, coef=0.86)
 
69
  mel = np.pad(mel, [(0, 0), (pad, pad), (0, 0)], mode="edge")
70
  ft = wavegru_inference(net, mel)
71
  ft = jax.device_get(ft[0])
72
+ wav = netcpp.inference(ft, 0.9)
73
  wav = np.array(wav)
74
  wav = librosa.mu_expand(wav - 127, mu=255)
75
  wav = librosa.effects.deemphasis(wav, coef=0.86)
wavegru.ckpt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f1232c7c32ac43f080f18c85ad50f1313aa5b34aebd3198e56288336b012585b
3
  size 58039876
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edd8a1ccc0a74a0b63fa416699fc0991e798d1444683be4eaf6a65249c56f8de
3
  size 58039876
wavegru_mod.cc CHANGED
@@ -122,18 +122,18 @@ struct WaveGRU {
122
  }
123
  o1.SpMM_bias(h, o1b, &fco1, true);
124
  o2.SpMM_bias(fco1, o2b, &fco2, false);
125
- auto max_logit = fco2[0];
126
- for (int i = 1; i <= 255; ++i) {
127
- max_logit = max(max_logit, fco2[i]);
128
- }
129
- float total = 0.0;
130
- for (int i = 0; i <= 255; ++i) {
131
- logits[i] = csrblocksparse::fast_exp(fco2[i] - max_logit);
132
- total += logits[i];
133
- }
134
- for (int i = 0; i <= 255; ++i) {
135
- if (logits[i] < total / 1024.0) fco2[i] = -1e9;
136
- }
137
  value = fco2.Sample(temperature);
138
  signal[index] = value;
139
  }
 
122
  }
123
  o1.SpMM_bias(h, o1b, &fco1, true);
124
  o2.SpMM_bias(fco1, o2b, &fco2, false);
125
+ // auto max_logit = fco2[0];
126
+ // for (int i = 1; i <= 255; ++i) {
127
+ // max_logit = max(max_logit, fco2[i]);
128
+ // }
129
+ // float total = 0.0;
130
+ // for (int i = 0; i <= 255; ++i) {
131
+ // logits[i] = csrblocksparse::fast_exp(fco2[i] - max_logit);
132
+ // total += logits[i];
133
+ // }
134
+ // for (int i = 0; i <= 255; ++i) {
135
+ // if (logits[i] < total / 1024.0) fco2[i] = -1e9;
136
+ // }
137
  value = fco2.Sample(temperature);
138
  signal[index] = value;
139
  }
wavegru_mod.so CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ca652aeaa19a5e02b0c1d2606a00520176b8d896b4b29b2d368e6fe8485a7e8d
3
  size 525536
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:700f2cade76db615b1e38bddfc9c604ff1c8ea1af3e507f879d0ceebae5d232d
3
  size 525536