Upload kokoro.py
Browse files
kokoro.py
CHANGED
@@ -135,8 +135,8 @@ def forward(model, tokens, ref_s, speed):
|
|
135 |
asr = t_en @ pred_aln_trg.unsqueeze(0).to(device)
|
136 |
return model.decoder(asr, F0_pred, N_pred, ref_s[:, :128]).squeeze().cpu().numpy()
|
137 |
|
138 |
-
def generate(model, text, voicepack, lang='a', speed=1):
|
139 |
-
ps = phonemize(text, lang)
|
140 |
tokens = tokenize(ps)
|
141 |
if not tokens:
|
142 |
return None
|
|
|
135 |
asr = t_en @ pred_aln_trg.unsqueeze(0).to(device)
|
136 |
return model.decoder(asr, F0_pred, N_pred, ref_s[:, :128]).squeeze().cpu().numpy()
|
137 |
|
138 |
+
def generate(model, text, voicepack, lang='a', speed=1, ps=None):
|
139 |
+
ps = ps or phonemize(text, lang)
|
140 |
tokens = tokenize(ps)
|
141 |
if not tokens:
|
142 |
return None
|