File size: 1,082 Bytes
2497835
 
 
cf00f70
2497835
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import datasets

_TAR_FILES=[
    "tmp.tar.gz"
    ]

class ZipDataset(datasets.GeneratorBasedBuilder):

    def _info(self):
        return datasets.DatasetInfo(
            description="TMP description",
            homepage="google it",
            citation="lmao",
            license="dunno, tbh, assume the worst, k thx."
        )

    def _split_generators(self, dl_manager):
        archive_path = dl_manager.download(_TAR_FILES[0])
        return [
            datasets.SplitGenerator(
                name=datasets.Split.TRAIN,
                gen_kwargs={
                    "images": dl_manager.iter_archive(archive_path),
                },
            ),
        ]

    def _generate_examples(self, images):
        """Generate images and labels for splits."""
        for file_path, file_obj in images:
            yield file_path, {
                "image": {"path": file_path, "bytes": file_obj.read()},
                }
        
        

#https://huggingface.co/datasets/oscar-corpus/OSCAR-2201/blob/main/OSCAR-2201.py
#https://huggingface.co/datasets/food101