nielsr HF staff commited on
Commit
ba37f72
1 Parent(s): 2d4f89c

Delete cats_image.py

Browse files
Files changed (1) hide show
  1. cats_image.py +0 -94
cats_image.py DELETED
@@ -1,94 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2021 The HuggingFace Team.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
-
17
- import textwrap
18
-
19
- import datasets
20
-
21
-
22
- _CITATION = """\\n"""
23
-
24
- _DESCRIPTION = """\\n"""
25
-
26
-
27
- class CatsImageConfig(datasets.BuilderConfig):
28
- """BuilderConfig for COCO cats image."""
29
-
30
- def __init__(
31
- self,
32
- data_url,
33
- url,
34
- task_templates=None,
35
- **kwargs,
36
- ):
37
- super(CatsImageConfig, self).__init__(
38
- version=datasets.Version("1.9.0", ""), **kwargs
39
- )
40
- self.data_url = data_url
41
- self.url = url
42
- self.task_templates = task_templates
43
-
44
-
45
- class CatsImage(datasets.GeneratorBasedBuilder):
46
- """Cats image. You know, THE cats image from the COCO dataset."""
47
-
48
- BUILDER_CONFIGS = [
49
- CatsImageConfig(
50
- name="image",
51
- description=textwrap.dedent(""),
52
- url="",
53
- data_url="",
54
- )
55
- ]
56
-
57
- DEFAULT_CONFIG_NAME = "image"
58
-
59
- def _info(self):
60
- return datasets.DatasetInfo(
61
- description=_DESCRIPTION,
62
- features=datasets.Features(
63
- {
64
- "id": datasets.Value("string"),
65
- "file": datasets.Value("string"),
66
- }
67
- ),
68
- supervised_keys=("file",),
69
- homepage=self.config.url,
70
- citation=_CITATION,
71
- )
72
-
73
- def _split_generators(self, dl_manager):
74
- DL_URLS = [
75
- f"https://huggingface.co/datasets/huggingface/cats-image/raw/main/{name}"
76
- for name in ["cats_image.jpeg"]
77
- ]
78
- archive_path = dl_manager.download_and_extract(DL_URLS)
79
- return [
80
- datasets.SplitGenerator(
81
- name=datasets.Split.TEST,
82
- gen_kwargs={"archive_path": archive_path},
83
- ),
84
- ]
85
-
86
- def _generate_examples(self, archive_path):
87
- """Generate examples."""
88
- for i, filename in enumerate(archive_path):
89
- key = str(i)
90
- example = {
91
- "id": key,
92
- "file": filename,
93
- }
94
- yield key, example