Skip to content

Commit 1fe9483

Browse files
authored
Expand no-code dataset info with datasets-server info (#6714)
* Expand no-code dataset info with datasets-server info * Nit
1 parent b7a16a0 commit 1fe9483

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/datasets/load.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,21 @@ def get_module(self) -> DatasetModule:
12281228
pass
12291229
metadata_configs = MetadataConfigs.from_dataset_card_data(dataset_card_data)
12301230
dataset_infos = DatasetInfosDict.from_dataset_card_data(dataset_card_data)
1231+
try:
1232+
exported_dataset_infos = _datasets_server.get_exported_dataset_infos(
1233+
dataset=self.name, revision=self.revision, token=self.download_config.token
1234+
)
1235+
exported_dataset_infos = DatasetInfosDict(
1236+
{
1237+
config_name: DatasetInfo.from_dict(exported_dataset_infos[config_name])
1238+
for config_name in exported_dataset_infos
1239+
}
1240+
)
1241+
except _datasets_server.DatasetsServerError:
1242+
exported_dataset_infos = None
1243+
if exported_dataset_infos:
1244+
exported_dataset_infos.update(dataset_infos)
1245+
dataset_infos = exported_dataset_infos
12311246
# we need a set of data files to find which dataset builder to use
12321247
# because we need to infer module name by files extensions
12331248
if self.data_files is not None:

0 commit comments

Comments
 (0)