Skip to content

Commit b0e10de

Browse files
jordiclivejordiclive
andauthored
hopefully fixing load_module bug and compatabe (#735)
Co-authored-by: jordiclive <jordiclive19@imperial.ac.uk>
1 parent d1a8b5d commit b0e10de

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

promptsource/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ def renameDatasetColumn(dataset):
3535

3636
def 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

7878
def 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

Comments
 (0)