Spaces:
Runtime error
Runtime error
Update inference.py
Browse files- inference.py +4 -1
inference.py
CHANGED
@@ -35,7 +35,10 @@ def text_to_mel(net, text, alphabet, config):
|
|
35 |
"""convert text to mel spectrogram"""
|
36 |
text = english_cleaners(text)
|
37 |
text = text + config["PAD"] * (100 - (len(text) % 100))
|
38 |
-
tokens = [
|
|
|
|
|
|
|
39 |
tokens = jnp.array(tokens, dtype=jnp.int32)
|
40 |
mel = tacotron_inference_fn(net, tokens[None])
|
41 |
return mel
|
|
|
35 |
"""convert text to mel spectrogram"""
|
36 |
text = english_cleaners(text)
|
37 |
text = text + config["PAD"] * (100 - (len(text) % 100))
|
38 |
+
tokens = []
|
39 |
+
for c in text:
|
40 |
+
if c in alphabet:
|
41 |
+
tokens.append(alphabet.index(c))
|
42 |
tokens = jnp.array(tokens, dtype=jnp.int32)
|
43 |
mel = tacotron_inference_fn(net, tokens[None])
|
44 |
return mel
|