Don't cache dataloader by default, raise if there is no valid path
This commit is contained in:
parent
2a68378421
commit
2e9f5030a3
@ -48,6 +48,8 @@ class Config(ConfigBase):
|
||||
gradient_accumulation_steps: int = 1
|
||||
sampling_temperature: float = 1.0
|
||||
|
||||
cache_dataloader: bool = False
|
||||
|
||||
@cached_property
|
||||
def get_spkr(self):
|
||||
return eval(self.spkr_name_getter)
|
||||
@ -87,7 +89,9 @@ class Config(ConfigBase):
|
||||
|
||||
@cached_property
|
||||
def diskcache(self):
|
||||
return diskcache.Cache(self.cache_dir).memoize
|
||||
if self.cache_dataloader:
|
||||
return diskcache.Cache(self.cache_dir).memoize
|
||||
return lambda: lambda x: x
|
||||
|
||||
|
||||
cfg = Config.from_cli()
|
||||
|
||||
@ -105,6 +105,9 @@ class VALLEDatset(Dataset):
|
||||
p for p in self.paths if len(self.paths_by_spkr_name[_get_spkr_name(p)]) > 1
|
||||
]
|
||||
|
||||
if len(self.paths) == 0:
|
||||
raise ValueError("No valid path is found. ")
|
||||
|
||||
if training:
|
||||
self.sampler = Sampler(self.paths, [_get_spkr_name])
|
||||
else:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user