diff --git a/vall_e/config.py b/vall_e/config.py index 3852f2b..4692b7f 100644 --- a/vall_e/config.py +++ b/vall_e/config.py @@ -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() diff --git a/vall_e/data.py b/vall_e/data.py index b92435f..a6c477a 100644 --- a/vall_e/data.py +++ b/vall_e/data.py @@ -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: