Skip to content

Commit e27351e

Browse files
authored
catch get_dataset_infos error for community datasets (#524)
* catch get_dataset_infos error for community datasets without dataset_info.json * rm the pool fixes
1 parent 9c0d502 commit e27351e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

promptsource/app.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,18 @@ def get_infos(d_name):
146146
all_infos[dataset_name] = infos
147147
else:
148148
infos = all_infos[dataset_name]
149-
if subset_name is None:
150-
subset_infos = infos[list(infos.keys())[0]]
151-
else:
152-
subset_infos = infos[subset_name]
149+
if infos:
150+
if subset_name is None:
151+
subset_infos = infos[list(infos.keys())[0]]
152+
else:
153+
subset_infos = infos[subset_name]
153154

154-
split_sizes = {k: v.num_examples for k, v in subset_infos.splits.items()}
155+
split_sizes = {k: v.num_examples for k, v in subset_infos.splits.items()}
156+
else:
157+
# Zaid/coqa_expanded and Zaid/quac_expanded don't have dataset_infos.json
158+
# so infos is an empty dic, and `infos[list(infos.keys())[0]]` raises an error
159+
# For simplicity, just filling `split_sizes` with nothing, so the displayed split sizes will be 0.
160+
split_sizes = {}
155161

156162
# Collect template counts, original task counts and names
157163
dataset_templates = template_collection.get_dataset(dataset_name, subset_name)

0 commit comments

Comments
 (0)