sleeping4cat commited on
Commit
1b63e77
·
verified ·
1 Parent(s): 8acbd14

Delete dataset.py

Browse files
Files changed (1) hide show
  1. dataset.py +0 -34
dataset.py DELETED
@@ -1,34 +0,0 @@
1
- import zipfile
2
- import pickle
3
- from datasets import GeneratorBasedBuilder, DatasetInfo, SplitGenerator, Split, Value
4
-
5
- class MyDataset(GeneratorBasedBuilder):
6
- """Custom Dataset using a Zip Archive"""
7
-
8
- _URL = "https://huggingface.co/datasets/sleeping-ai/arXiv-abstract-model2vec/resolve/main/"
9
- _URLS = {
10
- "train": _URL + "paper.zip",
11
- }
12
-
13
- def _info(self):
14
- return DatasetInfo(
15
- features={
16
- "file_name": Value("string"),
17
- "data": Value("binary"),
18
- }
19
- )
20
-
21
- def _split_generators(self, dl_manager):
22
- urls_to_download = self._URLS
23
- downloaded_files = dl_manager.download_and_extract(urls_to_download)
24
-
25
- return [
26
- SplitGenerator(name=Split.TRAIN, gen_kwargs={"archive_path": downloaded_files["train"]}),
27
- ]
28
-
29
- def _generate_examples(self, archive_path):
30
- with zipfile.ZipFile(archive_path, "r") as z:
31
- for file_name in z.namelist():
32
- with z.open(file_name) as f:
33
- data = pickle.load(f)
34
- yield file_name, {"file_name": file_name, "data": data}