Esempio n. 1
0
def pase_url(ckpt, model_config, refresh=False, **kwargs):
    """
    The model from URL
        ckpt (str): URL
        model_config (str): URL
    """
    ckpt = _urls_to_filepaths(ckpt, refresh=refresh)
    model_config = _urls_to_filepaths(model_config, refresh=refresh)
    return pase_local(ckpt, model_config, **kwargs)
Esempio n. 2
0
def decoar2_url(ckpt, refresh=False, *args, **kwargs):
    """
        The model from URL
            ckpt (str): URL
    """
    return decoar2_local(_urls_to_filepaths(ckpt, refresh=refresh), *args,
                         **kwargs)
Esempio n. 3
0
def timit_posteriorgram_url(ckpt, refresh=False, *args, **kwargs):
    """
        The model from URL
            ckpt (str): URL
    """
    return timit_posteriorgram_local(_urls_to_filepaths(ckpt, refresh=refresh),
                                     *args, **kwargs)
Esempio n. 4
0
def mockingjay_url(ckpt, refresh=False, *args, **kwargs):
    """
        The model from URL
            ckpt (str): URL
    """
    return mockingjay_local(_urls_to_filepaths(ckpt, refresh=refresh), *args,
                            **kwargs)
Esempio n. 5
0
def wav2vec2_url(ckpt, refresh=False, *args, **kwargs):
    """
        The model from google drive id
            ckpt (str): URL
            refresh (bool): whether to download ckpt/config again if existed
    """
    return wav2vec2_local(_urls_to_filepaths(ckpt, refresh=refresh), *args,
                          **kwargs)
Esempio n. 6
0
def vq_wav2vec_kmeans_roberta(refresh=False, **kwargs):
    vq_wav2vec = getattr(s3prl.hub, f'vq_wav2vec_kmeans')(refresh=refresh)

    tar_file = _urls_to_filepaths('https://dl.fbaipublicfiles.com/fairseq/wav2vec/bert_kmeans.tar', refresh=refresh)
    tar_dir = os.path.join(os.path.dirname(tar_file), 'vq_wav2vec_kmeans_roberta/')
    os.makedirs(tar_dir, exist_ok=True)
    os.system(f'tar -xf {tar_file} -C {tar_dir}')

    pt_files = glob.glob(os.path.join(tar_dir, '*.pt'))
    assert len(pt_files) == 1
    pt_file = pt_files[0]

    kwargs['model_name_or_path'] = tar_dir
    kwargs['checkpoint_file'] = pt_file
    return _vq_wav2vec_roberta(vq_wav2vec, **kwargs)
Esempio n. 7
0
def mos_wav2vec2_url(ckpt, refresh=False, *args, **kwargs):
    """
    The model from URL
        ckpt (str): URL
    """
    return mos_wav2vec2_local(_urls_to_filepaths(ckpt), *args, **kwargs)
Esempio n. 8
0
def cpc_url(ckpt, refresh=False, *args, **kwargs):
    """
        The model from URL
            ckpt (str): URL
    """
    return cpc_local(_urls_to_filepaths(ckpt), *args, **kwargs)
Esempio n. 9
0
def spec_augment_url(ckpt, refresh=False, *args, **kwargs):
    """
        The model from URL
            ckpt (str): URL
    """
    return spec_augment_local(_urls_to_filepaths(ckpt, refresh=refresh), *args, **kwargs)
Esempio n. 10
0
def audio_albert_url(ckpt, refresh=False, *args, **kwargs):
    """
        The model from URL
            ckpt (str): URL
    """
    return audio_albert_local(_urls_to_filepaths(ckpt, refresh=refresh), *args, **kwargs)