mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-28 09:08:54 +00:00
Ok good to go, gotta swap out with the base project
This commit is contained in:
@@ -4,6 +4,7 @@ from collections import defaultdict
|
|||||||
from style_tts2 import StyleTTS2
|
from style_tts2 import StyleTTS2
|
||||||
import torch
|
import torch
|
||||||
import torchaudio
|
import torchaudio
|
||||||
|
|
||||||
class CharacterData:
|
class CharacterData:
|
||||||
def __init__(self,full_path,char_name,file_name,ref_text) -> None:
|
def __init__(self,full_path,char_name,file_name,ref_text) -> None:
|
||||||
self.char_name = char_name
|
self.char_name = char_name
|
||||||
@@ -26,7 +27,6 @@ class TestHarness:
|
|||||||
self.test_text = ["This is!","Hello world testing!""This is a slightly... longer test.""This is a longer test, of style TTS Two!", "This should be a lengthy sentence."]
|
self.test_text = ["This is!","Hello world testing!""This is a slightly... longer test.""This is a longer test, of style TTS Two!", "This should be a lengthy sentence."]
|
||||||
self.test_characters = self.get_characters()
|
self.test_characters = self.get_characters()
|
||||||
|
|
||||||
|
|
||||||
def log_values(self,loss_gen_all, d_loss, loss_ce, loss_dur, loss_lm, loss_norm_rec,
|
def log_values(self,loss_gen_all, d_loss, loss_ce, loss_dur, loss_lm, loss_norm_rec,
|
||||||
loss_F0_rec, loss_sty, loss_diff, d_loss_slm, loss_gen_lm, iters, epoch, step,
|
loss_F0_rec, loss_sty, loss_diff, d_loss_slm, loss_gen_lm, iters, epoch, step,
|
||||||
log_interval, running_loss,train_list_len,batch_size):
|
log_interval, running_loss,train_list_len,batch_size):
|
||||||
@@ -63,12 +63,10 @@ class TestHarness:
|
|||||||
count = 0
|
count = 0
|
||||||
for char_name in char_name_ls.keys():
|
for char_name in char_name_ls.keys():
|
||||||
char_sample = char_name_ls[char_name]
|
char_sample = char_name_ls[char_name]
|
||||||
|
|
||||||
for sample in char_sample:
|
for sample in char_sample:
|
||||||
s_ref = Path(sample.full_path)
|
s_ref = Path(sample.full_path)
|
||||||
s_ref = model.compute_style(s_ref)
|
s_ref = model.compute_style(s_ref)
|
||||||
for i,text in enumerate(self.test_text):
|
for i,text in enumerate(self.test_text):
|
||||||
# we shouldn't set the embedding scale high on some text / input audio lengths it will break the audio
|
|
||||||
mono_wav = model.STinference(text=text,
|
mono_wav = model.STinference(text=text,
|
||||||
ref_text=sample.ref_text,
|
ref_text=sample.ref_text,
|
||||||
ref_s=s_ref,
|
ref_s=s_ref,
|
||||||
@@ -115,8 +113,6 @@ class TestHarness:
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
harness = TestHarness()
|
harness = TestHarness()
|
||||||
#harness.sample_ood_voice(file="testing.wav",sample_rate=24000,character="Raiden",caption="What I just Said")
|
|
||||||
#harness.sample_list_of_characters(file_path="./output/")
|
|
||||||
harness.test("Models/LibriTTS/epochs_2nd_00020.pth")
|
harness.test("Models/LibriTTS/epochs_2nd_00020.pth")
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user