Spaces:
Runtime error
Runtime error
John Langley
commited on
Commit
•
05aadad
1
Parent(s):
cc0e060
change to cpu
Browse files
utils.py
CHANGED
@@ -29,10 +29,13 @@ latent_map = {}
|
|
29 |
|
30 |
def get_latents(chatbot_voice, xtts_model, voice_cleanup=False):
|
31 |
global latent_map
|
32 |
-
|
|
|
|
|
33 |
speaker_wav = f"examples/{chatbot_voice}.wav"
|
34 |
if (voice_cleanup):
|
35 |
try:
|
|
|
36 |
cleanup_filter="lowpass=8000,highpass=75,areverse,silenceremove=start_periods=1:start_silence=0:start_threshold=0.02,areverse,silenceremove=start_periods=1:start_silence=0:start_threshold=0.02"
|
37 |
resample_filter="-ac 1 -ar 22050"
|
38 |
out_filename = speaker_wav + str(uuid.uuid4()) + ".wav" #ffmpeg to know output format
|
@@ -45,6 +48,7 @@ def get_latents(chatbot_voice, xtts_model, voice_cleanup=False):
|
|
45 |
# There was an error - command exited with non-zero code
|
46 |
print("Error: failed filtering, use original microphone input")
|
47 |
else:
|
|
|
48 |
speaker_wav=speaker_wav
|
49 |
# gets condition latents from the model
|
50 |
# returns tuple (gpt_cond_latent, speaker_embedding)
|
|
|
29 |
|
30 |
def get_latents(chatbot_voice, xtts_model, voice_cleanup=False):
|
31 |
global latent_map
|
32 |
+
print("here")
|
33 |
+
if chatbot_voice not in latent_map:
|
34 |
+
print("here1")
|
35 |
speaker_wav = f"examples/{chatbot_voice}.wav"
|
36 |
if (voice_cleanup):
|
37 |
try:
|
38 |
+
print("here2")
|
39 |
cleanup_filter="lowpass=8000,highpass=75,areverse,silenceremove=start_periods=1:start_silence=0:start_threshold=0.02,areverse,silenceremove=start_periods=1:start_silence=0:start_threshold=0.02"
|
40 |
resample_filter="-ac 1 -ar 22050"
|
41 |
out_filename = speaker_wav + str(uuid.uuid4()) + ".wav" #ffmpeg to know output format
|
|
|
48 |
# There was an error - command exited with non-zero code
|
49 |
print("Error: failed filtering, use original microphone input")
|
50 |
else:
|
51 |
+
print("here3")
|
52 |
speaker_wav=speaker_wav
|
53 |
# gets condition latents from the model
|
54 |
# returns tuple (gpt_cond_latent, speaker_embedding)
|