Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
innnky committed Feb 2, 2023
1 parent 5f04722 commit 8e02df2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, audiopaths, hparams):
random.shuffle(self.audiopaths)

def get_audio(self, filename):
filename = filename.replace("\\", "/")
audio, sampling_rate = load_wav_to_torch(filename)
if sampling_rate != self.sampling_rate:
raise ValueError("{} SR doesn't match target {} SR".format(
Expand All @@ -54,7 +55,7 @@ def get_audio(self, filename):
spec = torch.squeeze(spec, 0)
torch.save(spec, spec_filename)

spk = filename.replace("\\", "/").split("/")[-2]
spk = filename.split("/")[-2]
spk = torch.LongTensor([self.spk_map[spk]])

c = torch.load(filename + ".soft.pt").squeeze(0)
Expand Down Expand Up @@ -111,6 +112,7 @@ def __init__(self, audiopaths, hparams):


def get_audio(self, filename):
filename = filename.replace("\\", "/")
audio, sampling_rate = load_wav_to_torch(filename)
if sampling_rate != self.sampling_rate:
raise ValueError("{} SR doesn't match target {} SR".format(
Expand Down

0 comments on commit 8e02df2

Please sign in to comment.