[F] Fix #251: Expected a value of type 'str'

This commit is contained in:
Azalea Gui committed 2024-11-28 22:19:44 -05:00
1 parent 94f90e149e
commit 0c6e113aff
3 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -756,7 +756,7 @@ class tts_class:
):
"""Process text and prepare for batch inference"""
# Split the input text into batches
audio, sr = torchaudio.load(ref_audio)
audio, sr = torchaudio.load(str(ref_audio))
max_chars = int(len(ref_text.encode("utf-8")) / (audio.shape[-1] / sr) * (25 - audio.shape[-1] / sr))
gen_text_batches = self.chunk_text(gen_text, max_chars=max_chars)
+1 -1
View File
@@ -1113,7 +1113,7 @@ class tts_class:
else:
self.print_message("Starting non-streaming generation", message_type="debug_tts")
output = self.model.inference(**common_args)
torchaudio.save(output_file, torch.tensor(output["wav"]).unsqueeze(0), 24000)
torchaudio.save(str(output_file), torch.tensor(output["wav"]).unsqueeze(0), 24000)
self.print_message(f"Saved audio to: {output_file}", message_type="debug_tts")
elif self.current_model_loaded.startswith("apitts"):