INNER CODE UNIT · Python

scan_checkpoint

netease-youdao/EmotiVoice · demo_page_databaker.py:61

def scan_checkpoint(cp_dir, prefix, c=8):
    pattern = os.path.join(cp_dir, prefix + '?'*c)
    cp_list = glob.glob(pattern)
    if len(cp_list) == 0:
        return None
    return sorted(cp_list)[-1]

@st.cache_resource
def get_models():
    
    am_checkpoint_path = scan_checkpoint(f'{config.output_directory}/ckpt', 'g_')

    style_encoder_checkpoint_path = config.style_encoder_ckpt

    with open(config.model_config_path, 'r') as fin:
        conf = CONFIG.load_cfg(fin)
    
    conf.n_vocab = config.n_symbols

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…