rvorias commited on
Commit
f246a33
1 Parent(s): 173de37

fix: fix key error and dataset_infos

Browse files
.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": 72390,
85
- "num_examples": 175,
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": 177930282,
92
- "checksum": "b96fdea763d54939fbd8de3936ababd9fada7569a735f5b39b6dbbdbb27f98b5"
93
  },
94
  "https://huggingface.co/datasets/rvorias/realms_adventurers/resolve/main/metadata.json": {
95
- "num_bytes": 89974,
96
- "checksum": "c5f4130f05744481cdf6a52a835413cdd6c3a469c5c489f6a2ab03875800b047"
97
  }
98
  },
99
- "download_size": 178020256,
100
  "post_processing_size": null,
101
- "dataset_size": 72390,
102
- "size_in_bytes": 178092646
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
- else:
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)