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)
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)
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)
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)
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)
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)
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)
def cpc_url(ckpt, refresh=False, *args, **kwargs): """ The model from URL ckpt (str): URL """ return cpc_local(_urls_to_filepaths(ckpt), *args, **kwargs)
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)
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)