Update loader script
Browse files- pytorrent-standalone.py +6 -6
pytorrent-standalone.py
CHANGED
@@ -39,7 +39,7 @@ _LICENSE = ""
|
|
39 |
# The HuggingFace dataset library don't host the datasets but only point to the original files
|
40 |
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
41 |
_URLs = {
|
42 |
-
'
|
43 |
}
|
44 |
|
45 |
|
@@ -57,14 +57,14 @@ class PyTorrentStandalone(datasets.GeneratorBasedBuilder):
|
|
57 |
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
58 |
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
59 |
BUILDER_CONFIGS = [
|
60 |
-
datasets.BuilderConfig(name="
|
61 |
description="The corpus."),
|
62 |
]
|
63 |
|
64 |
-
|
65 |
|
66 |
def _info(self):
|
67 |
-
if self.config.name == "
|
68 |
features = datasets.Features(
|
69 |
{
|
70 |
"repo": datasets.Value("string"),
|
@@ -101,7 +101,7 @@ class PyTorrentStandalone(datasets.GeneratorBasedBuilder):
|
|
101 |
# extracted is returned instead of the archive
|
102 |
my_urls = _URLs[self.config.name]
|
103 |
data_path = dl_manager.download_and_extract(my_urls)
|
104 |
-
if self.config.name == '
|
105 |
return [
|
106 |
datasets.SplitGenerator(
|
107 |
name=datasets.Split.TRAIN,
|
@@ -109,7 +109,7 @@ class PyTorrentStandalone(datasets.GeneratorBasedBuilder):
|
|
109 |
gen_kwargs={
|
110 |
'data_path': data_path
|
111 |
}
|
112 |
-
)
|
113 |
]
|
114 |
|
115 |
def _generate_examples(
|
|
|
39 |
# The HuggingFace dataset library don't host the datasets but only point to the original files
|
40 |
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
41 |
_URLs = {
|
42 |
+
'default': "data.jsonl",
|
43 |
}
|
44 |
|
45 |
|
|
|
57 |
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
58 |
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
59 |
BUILDER_CONFIGS = [
|
60 |
+
datasets.BuilderConfig(name="default", version=VERSION,
|
61 |
description="The corpus."),
|
62 |
]
|
63 |
|
64 |
+
DEFAULT_CONFIG_NAME = "default" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
65 |
|
66 |
def _info(self):
|
67 |
+
if self.config.name == "default": # This is the name of the configuration selected in BUILDER_CONFIGS above
|
68 |
features = datasets.Features(
|
69 |
{
|
70 |
"repo": datasets.Value("string"),
|
|
|
101 |
# extracted is returned instead of the archive
|
102 |
my_urls = _URLs[self.config.name]
|
103 |
data_path = dl_manager.download_and_extract(my_urls)
|
104 |
+
if self.config.name == 'default':
|
105 |
return [
|
106 |
datasets.SplitGenerator(
|
107 |
name=datasets.Split.TRAIN,
|
|
|
109 |
gen_kwargs={
|
110 |
'data_path': data_path
|
111 |
}
|
112 |
+
),
|
113 |
]
|
114 |
|
115 |
def _generate_examples(
|