Spaces:
Sleeping
Sleeping
loading conditioning latents during voice creation
Browse files
app.py
CHANGED
@@ -64,11 +64,12 @@ def main():
|
|
64 |
if os.path.exists(voices_dir):
|
65 |
shutil.rmtree(voices_dir)
|
66 |
os.makedirs(voices_dir)
|
67 |
-
|
68 |
for index, uploaded_file in enumerate(uploaded_files):
|
69 |
bytes_data = uploaded_file.read()
|
70 |
with open(f"{voices_dir}voice_sample{index}.wav", "wb") as wav_file:
|
71 |
wav_file.write(bytes_data)
|
|
|
72 |
|
73 |
# # Generate conditioning latents and samples here
|
74 |
# voice_samples, conditioning_latents = generate_conditioning(voices_dir)
|
@@ -76,7 +77,7 @@ def main():
|
|
76 |
# # Save the conditioning latents and samples
|
77 |
# save_conditioning(voices_dir, voice_samples, conditioning_latents)
|
78 |
|
79 |
-
|
80 |
print(voice_samples, conditioning_latents)
|
81 |
|
82 |
st.session_state["text_input_key"] = str(randint(1000, 100000000))
|
|
|
64 |
if os.path.exists(voices_dir):
|
65 |
shutil.rmtree(voices_dir)
|
66 |
os.makedirs(voices_dir)
|
67 |
+
voice_samples = []
|
68 |
for index, uploaded_file in enumerate(uploaded_files):
|
69 |
bytes_data = uploaded_file.read()
|
70 |
with open(f"{voices_dir}voice_sample{index}.wav", "wb") as wav_file:
|
71 |
wav_file.write(bytes_data)
|
72 |
+
voice_samples.append(f"{voices_dir}voice_sample{index}.wav")
|
73 |
|
74 |
# # Generate conditioning latents and samples here
|
75 |
# voice_samples, conditioning_latents = generate_conditioning(voices_dir)
|
|
|
77 |
# # Save the conditioning latents and samples
|
78 |
# save_conditioning(voices_dir, voice_samples, conditioning_latents)
|
79 |
|
80 |
+
conditioning_latents = TextToSpeech.get_conditioning_latents(voice_samples=voice_samples)
|
81 |
print(voice_samples, conditioning_latents)
|
82 |
|
83 |
st.session_state["text_input_key"] = str(randint(1000, 100000000))
|