Spaces:
Running
Running
File size: 601 Bytes
cbb886a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import huggingface_hub
import datasets
def check_dataset_and_get_config(dataset_id):
try:
configs = datasets.get_dataset_config_names(dataset_id)
return configs
except Exception:
# Dataset may not exist
return None
def check_dataset_and_get_split(dataset_id, dataset_config):
try:
ds = datasets.load_dataset(dataset_id, dataset_config)
except Exception:
# Dataset may not exist
return None
try:
splits = list(ds.keys())
return splits
except Exception:
# Dataset has no splits
return None |