Update test.py
Browse files
test.py
CHANGED
|
@@ -16,12 +16,12 @@ _HOMEPAGE = ""
|
|
| 16 |
|
| 17 |
_LICENSE = ""
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
class imgdataset(datasets.GeneratorBasedBuilder):
|
| 27 |
""""""
|
|
@@ -44,30 +44,28 @@ class imgdataset(datasets.GeneratorBasedBuilder):
|
|
| 44 |
|
| 45 |
}
|
| 46 |
)
|
| 47 |
-
else:
|
| 48 |
-
features = datasets.Features(
|
| 49 |
-
{
|
| 50 |
-
"Class_name": datasets.Value("string"),
|
| 51 |
-
"file_name": datasets.Value("string"),
|
| 52 |
-
"file_id": datasets.Value("string")
|
| 53 |
-
|
| 54 |
-
}
|
| 55 |
-
)
|
| 56 |
return datasets.DatasetInfo(
|
| 57 |
description=_DESCRIPTION,
|
| 58 |
features=features,
|
| 59 |
)
|
| 60 |
|
| 61 |
-
def _split_generators(self, dl_manager):
|
| 62 |
"""This function returns the examples in the raw (text) form."""
|
| 63 |
-
|
| 64 |
-
# data_dir = dl_manager.download_and_extract(urls)
|
| 65 |
return [
|
| 66 |
datasets.SplitGenerator(
|
| 67 |
name=datasets.Split.TRAIN,
|
| 68 |
# These kwargs will be passed to _generate_examples
|
| 69 |
gen_kwargs={
|
| 70 |
-
"filepath": os.path.join(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
"split": "train",
|
| 72 |
},
|
| 73 |
),
|
|
|
|
| 16 |
|
| 17 |
_LICENSE = ""
|
| 18 |
|
| 19 |
+
_URL = "data/"
|
| 20 |
|
| 21 |
+
_URLS = {
|
| 22 |
+
"train": _URL + 'train1_dataset.csv',
|
| 23 |
+
"reg": _URL + 'reg1_dataset.csv',
|
| 24 |
+
}
|
| 25 |
|
| 26 |
class imgdataset(datasets.GeneratorBasedBuilder):
|
| 27 |
""""""
|
|
|
|
| 44 |
|
| 45 |
}
|
| 46 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
return datasets.DatasetInfo(
|
| 48 |
description=_DESCRIPTION,
|
| 49 |
features=features,
|
| 50 |
)
|
| 51 |
|
| 52 |
+
def _split_generators(self, dl_manager: datasets.DownloadManager):
|
| 53 |
"""This function returns the examples in the raw (text) form."""
|
| 54 |
+
downloaded_files = dl_manager.download_and_extract(_URLS)
|
|
|
|
| 55 |
return [
|
| 56 |
datasets.SplitGenerator(
|
| 57 |
name=datasets.Split.TRAIN,
|
| 58 |
# These kwargs will be passed to _generate_examples
|
| 59 |
gen_kwargs={
|
| 60 |
+
"filepath": os.path.join(downloaded_files['train']),
|
| 61 |
+
"split": "train",
|
| 62 |
+
},
|
| 63 |
+
),
|
| 64 |
+
datasets.SplitGenerator(
|
| 65 |
+
name=datasets.Split.TRAIN,
|
| 66 |
+
# These kwargs will be passed to _generate_examples
|
| 67 |
+
gen_kwargs={
|
| 68 |
+
"filepath": os.path.join(downloaded_files['reg']),
|
| 69 |
"split": "train",
|
| 70 |
},
|
| 71 |
),
|