Update deepbindweight.py
Browse files- deepbindweight.py +10 -6
deepbindweight.py
CHANGED
|
@@ -10,13 +10,16 @@ logger = datasets.logging.get_logger(__name__)
|
|
| 10 |
ID_POOL = ()
|
| 11 |
URL = "https://huggingface.co/datasets/thewall/DeepBindWeight/blob/main/params"
|
| 12 |
|
| 13 |
-
class
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
-
class
|
| 18 |
BUILDER_CONFIGS = [
|
| 19 |
-
|
| 20 |
]
|
| 21 |
|
| 22 |
DEFAULT_CONFIG_NAME = "D00328.003"
|
|
@@ -34,6 +37,7 @@ class JolmaLocal(datasets.GeneratorBasedBuilder):
|
|
| 34 |
|
| 35 |
def _split_generators(self, dl_manager):
|
| 36 |
url = f"{URL}/{self.config.name}.txt"
|
|
|
|
| 37 |
downloaded_files = dl_manager.download_and_extract(url)
|
| 38 |
return [
|
| 39 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files}),
|
|
@@ -47,6 +51,6 @@ class JolmaLocal(datasets.GeneratorBasedBuilder):
|
|
| 47 |
|
| 48 |
if __name__=="__main__":
|
| 49 |
from datasets import load_dataset
|
| 50 |
-
dataset = load_dataset("deepbindweight
|
| 51 |
-
dataset.push_to_hub("thewall/DeepBindWeight")
|
| 52 |
|
|
|
|
| 10 |
ID_POOL = ()
|
| 11 |
URL = "https://huggingface.co/datasets/thewall/DeepBindWeight/blob/main/params"
|
| 12 |
|
| 13 |
+
class DeepBindWeightConfig(datasets.BuilderConfig):
|
| 14 |
+
def __init__(self, **kwargs):
|
| 15 |
+
data_files = f"params/{kwargs['name']}.txt"
|
| 16 |
+
kwargs['data_files'] = data_files
|
| 17 |
+
super(DeepBindWeightConfig, self).__init__(**kwargs)
|
| 18 |
|
| 19 |
|
| 20 |
+
class DeepBindWeight(datasets.GeneratorBasedBuilder):
|
| 21 |
BUILDER_CONFIGS = [
|
| 22 |
+
DeepBindWeightConfig(name=key) for key in ID_POOL
|
| 23 |
]
|
| 24 |
|
| 25 |
DEFAULT_CONFIG_NAME = "D00328.003"
|
|
|
|
| 37 |
|
| 38 |
def _split_generators(self, dl_manager):
|
| 39 |
url = f"{URL}/{self.config.name}.txt"
|
| 40 |
+
logger.info(f"download from {url}")
|
| 41 |
downloaded_files = dl_manager.download_and_extract(url)
|
| 42 |
return [
|
| 43 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files}),
|
|
|
|
| 51 |
|
| 52 |
if __name__=="__main__":
|
| 53 |
from datasets import load_dataset
|
| 54 |
+
dataset = load_dataset("thewall/deepbindweight", split="all")
|
| 55 |
+
# dataset.push_to_hub("thewall/DeepBindWeight")
|
| 56 |
|