Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -146,7 +146,7 @@ def audio_tensor_to_opus_bytes(audio_tensor: torch.Tensor, sample_rate: int = 24
|
|
146 |
|
147 |
|
148 |
# Initialize G2P for English (American)
|
149 |
-
g2p =
|
150 |
|
151 |
def tokenizer(text: str):
|
152 |
"""
|
@@ -154,7 +154,7 @@ def tokenizer(text: str):
|
|
154 |
"""
|
155 |
phonemes_string, _ = g2p(text)
|
156 |
phonemes = [ph for ph in phonemes_string]
|
157 |
-
print(
|
158 |
tokens = [phoneme_vocab[phoneme] for phoneme in phonemes if phoneme in phoneme_vocab]
|
159 |
return tokens
|
160 |
|
|
|
146 |
|
147 |
|
148 |
# Initialize G2P for English (American)
|
149 |
+
g2p = en.G2P(trf=False, british=False, fallback=None)
|
150 |
|
151 |
def tokenizer(text: str):
|
152 |
"""
|
|
|
154 |
"""
|
155 |
phonemes_string, _ = g2p(text)
|
156 |
phonemes = [ph for ph in phonemes_string]
|
157 |
+
print(phonemes_string)
|
158 |
tokens = [phoneme_vocab[phoneme] for phoneme in phonemes if phoneme in phoneme_vocab]
|
159 |
return tokens
|
160 |
|