Ejemplo n.º 1
0
def download_adaptor(download_link: str,
                     path_to_save: str,
                     make_dir: bool = False):
    """Downloads an adaptor via given `download_link`.

    Parameters
    ----------
    download_link: str
        Direct downloadable link.
    path_to_save: str
        Path to save the adaptor.
    make_dir: bool
        Whether to make directory if it does not exist.

    Returns
    -------
    adaptor: :class:`~scarches.models.Adaptor`
        object of the new Adaptor.
        """
    import pickle
    if download_link != "":
        file_path, response = download_file(download_link,
                                            path_to_save,
                                            make_dir=make_dir)
        adaptor = pickle.load(open(file_path, 'rb'))
        return adaptor
Ejemplo n.º 2
0
def __download_pretrained_scArches(download_link: str,
                                save_path: str = './',
                                make_dir=False):
    if download_link != '':
        file_path, response = download_file(download_link, save_path, make_dir)
        return file_path
    else:
        raise Exception("Download link does not exist for the specified task")