Update coqui.py
Browse files
coqui.py
CHANGED
@@ -88,7 +88,7 @@ model.load_checkpoint(
|
|
88 |
checkpoint_dir=model_path,
|
89 |
vocab_path=vocab_path,
|
90 |
eval=True,
|
91 |
-
use_deepspeed=
|
92 |
)
|
93 |
model.cuda()
|
94 |
|
@@ -133,6 +133,15 @@ def predict(
|
|
133 |
no_lang_auto_detect,
|
134 |
agree,
|
135 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
if agree == True:
|
137 |
if language not in supported_languages:
|
138 |
print(
|
@@ -321,7 +330,7 @@ def predict(
|
|
321 |
# Convert chunk to numpy array and return it
|
322 |
chunk_np = chunk.cpu().numpy()
|
323 |
print('chunk',i)
|
324 |
-
yield (24000
|
325 |
wav_chunks.append(chunk)
|
326 |
|
327 |
print(f"Received chunk {i} of audio length {chunk.shape[-1]}")
|
@@ -415,4 +424,4 @@ def predict(
|
|
415 |
print("Please accept the Terms & Condition!")
|
416 |
return (
|
417 |
None,
|
418 |
-
)
|
|
|
88 |
checkpoint_dir=model_path,
|
89 |
vocab_path=vocab_path,
|
90 |
eval=True,
|
91 |
+
use_deepspeed=False,
|
92 |
)
|
93 |
model.cuda()
|
94 |
|
|
|
133 |
no_lang_auto_detect,
|
134 |
agree,
|
135 |
):
|
136 |
+
print("####################################### Predict Called ##############################")
|
137 |
+
print("promp:",prompt)
|
138 |
+
print("language:",language)
|
139 |
+
print("audio_file_pth:",audio_file_pth)
|
140 |
+
print("mic_file_path:",mic_file_path)
|
141 |
+
print("use_mic:",use_mic)
|
142 |
+
print("voice_cleanup:",voice_cleanup)
|
143 |
+
print("no_lang_auto_detect:",no_lang_auto_detect)
|
144 |
+
print("agree:",agree)
|
145 |
if agree == True:
|
146 |
if language not in supported_languages:
|
147 |
print(
|
|
|
330 |
# Convert chunk to numpy array and return it
|
331 |
chunk_np = chunk.cpu().numpy()
|
332 |
print('chunk',i)
|
333 |
+
yield numpy_to_mp3(chunk_np,24000)
|
334 |
wav_chunks.append(chunk)
|
335 |
|
336 |
print(f"Received chunk {i} of audio length {chunk.shape[-1]}")
|
|
|
424 |
print("Please accept the Terms & Condition!")
|
425 |
return (
|
426 |
None,
|
427 |
+
)
|