Datasets:
fix: fix key error and dataset_infos
Browse files- .gitattributes +2 -0
- dataset_infos.json +9 -9
- realms_adventurers.py +3 -1
- test_dataset.py +8 -0
.gitattributes
CHANGED
@@ -52,3 +52,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
55 |
+
data filter=lfs diff=lfs merge=lfs -text
|
56 |
+
metadata.json filter=lfs diff=lfs merge=lfs -text
|
dataset_infos.json
CHANGED
@@ -81,24 +81,24 @@
|
|
81 |
"splits": {
|
82 |
"train": {
|
83 |
"name": "train",
|
84 |
-
"num_bytes":
|
85 |
-
"num_examples":
|
86 |
"dataset_name": "realms_adventurers"
|
87 |
}
|
88 |
},
|
89 |
"download_checksums": {
|
90 |
"https://huggingface.co/datasets/rvorias/realms_adventurers/resolve/main/data/images_001.zip": {
|
91 |
-
"num_bytes":
|
92 |
-
"checksum": "
|
93 |
},
|
94 |
"https://huggingface.co/datasets/rvorias/realms_adventurers/resolve/main/metadata.json": {
|
95 |
-
"num_bytes":
|
96 |
-
"checksum": "
|
97 |
}
|
98 |
},
|
99 |
-
"download_size":
|
100 |
"post_processing_size": null,
|
101 |
-
"dataset_size":
|
102 |
-
"size_in_bytes":
|
103 |
}
|
104 |
}
|
|
|
81 |
"splits": {
|
82 |
"train": {
|
83 |
"name": "train",
|
84 |
+
"num_bytes": 327239,
|
85 |
+
"num_examples": 830,
|
86 |
"dataset_name": "realms_adventurers"
|
87 |
}
|
88 |
},
|
89 |
"download_checksums": {
|
90 |
"https://huggingface.co/datasets/rvorias/realms_adventurers/resolve/main/data/images_001.zip": {
|
91 |
+
"num_bytes": 1225778440,
|
92 |
+
"checksum": "c7c750800f66e1b0bb0fd1a6fe0e558ce6921f369ec75350a09ece26b5f7f3f3"
|
93 |
},
|
94 |
"https://huggingface.co/datasets/rvorias/realms_adventurers/resolve/main/metadata.json": {
|
95 |
+
"num_bytes": 859089,
|
96 |
+
"checksum": "9d4b69f81f6347060c70a3b1d025a56fe1345a660963883b7eb78f10cded41d3"
|
97 |
}
|
98 |
},
|
99 |
+
"download_size": 1226637529,
|
100 |
"post_processing_size": null,
|
101 |
+
"dataset_size": 327239,
|
102 |
+
"size_in_bytes": 1226964768
|
103 |
}
|
104 |
}
|
realms_adventurers.py
CHANGED
@@ -106,8 +106,10 @@ class RealmsAdventurersDataset(datasets.GeneratorBasedBuilder):
|
|
106 |
image_path = os.path.join(root_dir, sample["file_name"])
|
107 |
if "caption" in sample:
|
108 |
caption = sample["caption"]
|
109 |
-
|
110 |
caption = sample["discord_prompt"]
|
|
|
|
|
111 |
with open(image_path, "rb") as file_obj:
|
112 |
yield image_path, {
|
113 |
"image": {"path": image_path, "bytes": file_obj.read()},
|
|
|
106 |
image_path = os.path.join(root_dir, sample["file_name"])
|
107 |
if "caption" in sample:
|
108 |
caption = sample["caption"]
|
109 |
+
elif "discord_prompt" in sample:
|
110 |
caption = sample["discord_prompt"]
|
111 |
+
else:
|
112 |
+
continue
|
113 |
with open(image_path, "rb") as file_obj:
|
114 |
yield image_path, {
|
115 |
"image": {"path": image_path, "bytes": file_obj.read()},
|
test_dataset.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
|
3 |
+
with open("metadata.json", "r") as f:
|
4 |
+
data = json.load(f)
|
5 |
+
|
6 |
+
for sample in data:
|
7 |
+
if "caption" not in sample and "discord_prompt" not in sample:
|
8 |
+
print(sample)
|