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 c8b690d commit 5f04722
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_audio(self, filename):
spec = torch.squeeze(spec, 0)
torch.save(spec, spec_filename)

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

c = torch.load(filename + ".soft.pt").squeeze(0)
Expand Down
2 changes: 1 addition & 1 deletion inference/infer_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def read_temp(file_name):
data = f.read()
data_dict = json.loads(data)
if os.path.getsize(file_name) > 50 * 1024 * 1024:
f_name = file_name.split("/")[-1]
f_name = file_name.replace("\\", "/").split("/")[-1]
print(f"clean {f_name}")
for wav_hash in list(data_dict.keys()):
if int(time.time()) - int(data_dict[wav_hash]["time"]) > 14 * 24 * 3600:
Expand Down
2 changes: 1 addition & 1 deletion resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def process(item):
spkdir, wav_name, args = item
# speaker 's5', 'p280', 'p315' are excluded,
speaker = spkdir.split("/")[-1]
speaker = spkdir.replace("\\", "/").split("/")[-1]
wav_path = os.path.join(args.in_dir, speaker, wav_name)
if os.path.exists(wav_path) and '.wav' in wav_path:
os.makedirs(os.path.join(args.out_dir2, speaker), exist_ok=True)
Expand Down

0 comments on commit 5f04722

Please sign in to comment.