@@ -35,12 +35,12 @@ def renameDatasetColumn(dataset):
3535
3636def get_dataset_builder (path , conf = None ):
3737 "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 )
4040 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 )
4242 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 )
4444 return builder_instance
4545
4646
@@ -77,9 +77,9 @@ def load_dataset(dataset_name, subset_name):
7777
7878def get_dataset_confs (path ):
7979 "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
8181 # 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 )
8383 # Instantiate the dataset builder
8484 confs = builder_cls .BUILDER_CONFIGS
8585 if confs and len (confs ) > 1 :
0 commit comments