Upload dave.py with huggingface_hub
Browse files
dave.py
CHANGED
@@ -97,15 +97,15 @@ class DaveDataset(datasets.GeneratorBasedBuilder):
|
|
97 |
with open(json_path, "r", encoding="utf-8") as f:
|
98 |
data = json.load(f)
|
99 |
|
100 |
-
print(downloaded_files)
|
101 |
-
|
102 |
for idx, item in enumerate(data):
|
|
|
103 |
for field in _MEDIA_FIELDS:
|
|
|
|
|
104 |
if field not in item:
|
105 |
-
print(f"Field {field} in item: {item[field]}")
|
106 |
continue
|
107 |
if item[field] not in downloaded_files:
|
108 |
-
|
109 |
item[field] = downloaded_files[item[field]]
|
110 |
|
111 |
yield idx, item
|
|
|
97 |
with open(json_path, "r", encoding="utf-8") as f:
|
98 |
data = json.load(f)
|
99 |
|
|
|
|
|
100 |
for idx, item in enumerate(data):
|
101 |
+
|
102 |
for field in _MEDIA_FIELDS:
|
103 |
+
if "P02" not in item[field]:
|
104 |
+
continue
|
105 |
if field not in item:
|
|
|
106 |
continue
|
107 |
if item[field] not in downloaded_files:
|
108 |
+
continue
|
109 |
item[field] = downloaded_files[item[field]]
|
110 |
|
111 |
yield idx, item
|