fix skip download feature
Browse files33 unmodified lines343536373839406 unmodified lines4748495051525354554 unmodified lines606162636465666768697071727374757677787980818242 unmodified lines12512612712812913013113213313413520 unmodified lines15615715815916033 unmodified lines# TODO: Add description of the dataset here# You can copy an official description_DESCRIPTION = """\A dataset to refine language models on protein-ligand binding affinity prediction."""# TODO: Add a link to an official homepage for the dataset here6 unmodified lines# The HuggingFace dataset library don't host the datasets but only point to the original files# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)_URL = "https://huggingface.co/datasets/jglaser/binding_affinity/resolve/main/"_file_names = {'default': 'data/all.parquet','no_kras': 'data/all_nokras.parquet'}_URLs = {name: _URL+_file_names[name] for name in _file_names}4 unmodified linesVERSION = datasets.Version("1.1.0")# If you don't want/need to define several sub-sets in your dataset,# just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.# If you need to make complex sub-parts in the datasets with configurable options# You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig# BUILDER_CONFIG_CLASS = MyBuilderConfig# You will be able to load one or the other configurations in the following list with# data = datasets.load_dataset('my_dataset', 'first_domain')# data = datasets.load_dataset('my_dataset', 'second_domain')# BUILDER_CONFIGS = [# datasets.BuilderConfig(name="first_domain", version=VERSION, description="This part of my dataset covers a first domain"),# datasets.BuilderConfig(name="second_domain", version=VERSION, description="This part of my dataset covers a second domain"),#]#DEFAULT_CONFIG_NAME = "affinities" # It's not mandatory to have a default configuration. Just use one if it make sense.def _info(self):# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset#if self.config.name == "first_domain": # This is the name of the configuration selected in BUILDER_CONFIGS above42 unmodified lines# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archivefiles = _file_namestry:files = dl_manager.download_and_extract(_URLs)except:passreturn [datasets.SplitGenerator(20 unmodified lineslocal = fs.LocalFileSystem()for i, f in enumerate([filepath]):print(f)yield i, pq.read_table(f,filesystem=local)33 unmodified lines343536373839406 unmodified lines4748495051525354554 unmodified lines60616263646542 unmodified lines10810911011111211311411511611711811920 unmodified lines14014114214333 unmodified lines# TODO: Add description of the dataset here# You can copy an official description_DESCRIPTION = """\A dataset to fine-tune language models on protein-ligand binding affinity prediction."""# TODO: Add a link to an official homepage for the dataset here6 unmodified lines# The HuggingFace dataset library don't host the datasets but only point to the original files# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)_URL = "https://huggingface.co/datasets/jglaser/binding_affinity/resolve/main/"_data_dir = "data/"_file_names = {'default': _data_dir+'all.parquet','no_kras': _data_dir+'all_nokras.parquet'}_URLs = {name: _URL+_file_names[name] for name in _file_names}4 unmodified linesVERSION = datasets.Version("1.1.0")def _info(self):# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset#if self.config.name == "first_domain": # This is the name of the configuration selected in BUILDER_CONFIGS above42 unmodified lines# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archiveimport osif os.path.exists(dl_manager._base_path):# this is a hack to force the use of the local copyfiles = dl_manager.download_and_extract({fn: os.path.join(dl_manager._base_path, _file_names[fn]) for fn in _file_names})else:files = dl_manager.download_and_extract(_URLs)return [datasets.SplitGenerator(20 unmodified lineslocal = fs.LocalFileSystem()for i, f in enumerate([filepath]):yield i, pq.read_table(f,filesystem=local)
binding_affinity.py+9-26