@@ -35,12 +35,12 @@ def renameDatasetColumn(dataset):
35
35
36
36
def get_dataset_builder (path , conf = None ):
37
37
"Get a dataset builder from name and conf."
38
- module_path = datasets .load .prepare_module (path , dataset = True )
39
- builder_cls = datasets .load .import_main_class (module_path [ 0 ] , dataset = True )
38
+ module_path = datasets .load .dataset_module_factory (path )
39
+ builder_cls = datasets .load .import_main_class (module_path . module_path , dataset = True )
40
40
if conf :
41
- builder_instance = builder_cls (name = conf , cache_dir = None , hash = module_path [ 1 ] )
41
+ builder_instance = builder_cls (name = conf , cache_dir = None , hash = module_path . hash )
42
42
else :
43
- builder_instance = builder_cls (cache_dir = None , hash = module_path [ 1 ] )
43
+ builder_instance = builder_cls (cache_dir = None , hash = module_path . hash )
44
44
return builder_instance
45
45
46
46
@@ -77,9 +77,9 @@ def load_dataset(dataset_name, subset_name):
77
77
78
78
def get_dataset_confs (path ):
79
79
"Get the list of confs for a dataset."
80
- module_path = datasets .load .prepare_module (path , dataset = True )
80
+ module_path = datasets .load .dataset_module_factory (path ). module_path
81
81
# Get dataset builder class from the processing script
82
- builder_cls = datasets .load .import_main_class (module_path [ 0 ] , dataset = True )
82
+ builder_cls = datasets .load .import_main_class (module_path , dataset = True )
83
83
# Instantiate the dataset builder
84
84
confs = builder_cls .BUILDER_CONFIGS
85
85
if confs and len (confs ) > 1 :
0 commit comments