pesky dot

This commit is contained in:
mrq 2023-08-20 22:41:55 -05:00
parent cbd3c95c42
commit b10c58436d

View File

@ -101,7 +101,7 @@ def get_voice( name, dir=get_voice_dir(), load_latents=True, extensions=["wav",
files = os.listdir(subj) files = os.listdir(subj)
if load_latents: if load_latents:
extensions.append(".pth") extensions.append("pth")
voice = [] voice = []
for file in files: for file in files:
@ -113,7 +113,7 @@ def get_voice( name, dir=get_voice_dir(), load_latents=True, extensions=["wav",
return sorted( voice ) return sorted( voice )
def get_voice_list(dir=get_voice_dir(), append_defaults=False, extensions=["wav", "mp3", "flac", "pth"]): def get_voice_list(dir=get_voice_dir(), append_defaults=False, load_latents=True, extensions=["wav", "mp3", "flac"]):
defaults = [ "random", "microphone" ] defaults = [ "random", "microphone" ]
os.makedirs(dir, exist_ok=True) os.makedirs(dir, exist_ok=True)
#res = sorted([d for d in os.listdir(dir) if d not in defaults and os.path.isdir(os.path.join(dir, d)) and len(os.listdir(os.path.join(dir, d))) > 0 ]) #res = sorted([d for d in os.listdir(dir) if d not in defaults and os.path.isdir(os.path.join(dir, d)) and len(os.listdir(os.path.join(dir, d))) > 0 ])
@ -126,7 +126,7 @@ def get_voice_list(dir=get_voice_dir(), append_defaults=False, extensions=["wav"
continue continue
if len(os.listdir(os.path.join(dir, name))) == 0: if len(os.listdir(os.path.join(dir, name))) == 0:
continue continue
files = get_voice( name, dir=dir, extensions=extensions ) files = get_voice( name, dir=dir, extensions=extensions, load_latents=load_latents )
if len(files) > 0: if len(files) > 0:
res.append(name) res.append(name)
@ -134,7 +134,7 @@ def get_voice_list(dir=get_voice_dir(), append_defaults=False, extensions=["wav"
for subdir in os.listdir(f'{dir}/{name}'): for subdir in os.listdir(f'{dir}/{name}'):
if not os.path.isdir(f'{dir}/{name}/{subdir}'): if not os.path.isdir(f'{dir}/{name}/{subdir}'):
continue continue
files = get_voice( f'{name}/{subdir}', dir=dir, extensions=extensions ) files = get_voice( f'{name}/{subdir}', dir=dir, extensions=extensions, load_latents=load_latents )
if len(files) == 0: if len(files) == 0:
continue continue
res.append(f'{name}/{subdir}') res.append(f'{name}/{subdir}')