def override_config(): config = locator.get_config() config.build = 1000 config.display_interval = 1 config.checkpoint_interval = 2 config.cache_size = config.batch_size * 2 config.verbose = False
def get_trainer(self, stage: int): return Trainer(locator.get_config(), locator.get_filesystem_provider(), locator.get_acoustic_model(), locator.get_evaluator(), locator.get_frontend_processor(), stage=stage)
core_config.__dict__.update(config.__dict__) # original common config module extends config.__dict__.update(core_config.__dict__) return config def with_generated_params(config): import vui.frontend.dsp as dsp config.seg_length = dsp.get_best_segment_length(config.framerate) config.freq_count = dsp.get_freq_count(config.seg_length) config.freq_res = dsp.get_freq_resolution( config.framerate, config.freq_count) config.frontend_shape = (config.spectrums_per_sec, config.harmonics_count) return config config = locator.get_config() config = with_core_params(config) config = with_generated_params(config) if not config.verbose: os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' print("Build {}".format(config.build)) def run(word_handler: Callable, duration: Optional[float] = None): vui = locator.get_voice_user_interface(word_handler) vui.run(duration)
def get_wav_folder_storage(dataset_name: str) -> InMemoryStorage: path = locator.get_filesystem_provider().get_dataset_path( "r", dataset_name) max_length = locator.get_config().framerate return get_storage_from_wav_folder(path, max_length)
def run_training(): with HiddenPrints(): import train stages = locator.get_config().stages for stage in range(stages): train.main(stage, 2)