fixed the overwrite regression for bark and vall-e backends too

This commit is contained in:
mrq 2023-08-24 19:46:42 +00:00
parent f5fab33e9c
commit 533b73e083

View File

@ -432,7 +432,7 @@ def generate_bark(**kwargs):
for i, file in enumerate(os.listdir(outdir)):
filename = os.path.basename(file)
extension = os.path.splitext(filename)[-1][1:]
if extension != ".json" and extension != ".wav":
if extension != "json" and extension != "wav":
continue
match = re.findall(rf"^{cleanup_voice_name(voice)}_(\d+)(?:.+?)?{extension}$", filename)
if match and len(match) > 0:
@ -734,7 +734,7 @@ def generate_valle(**kwargs):
for i, file in enumerate(os.listdir(outdir)):
filename = os.path.basename(file)
extension = os.path.splitext(filename)[-1][1:]
if extension != ".json" and extension != ".wav":
if extension != "json" and extension != "wav":
continue
match = re.findall(rf"^{voice}_(\d+)(?:.+?)?{extension}$", filename)
if match and len(match) > 0: