Skip to content

Commit 941a6bc

Browse files
committed
fix base_path
1 parent c3ddbd0 commit 941a6bc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/datasets/builder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,12 @@ def create_config_id(
213213
else:
214214
return self.name
215215

216-
def _resolve_data_files(self, base_path: str, download_config: DownloadConfig) -> None:
216+
def _resolve_data_files(self, base_path: Optional[str], download_config: DownloadConfig) -> None:
217217
if isinstance(self.data_files, DataFilesPatternsDict):
218-
base_path = xjoin(base_path, self.data_dir) if self.data_dir else base_path
218+
if base_path is None:
219+
base_path = self.data_dir
220+
else:
221+
base_path = xjoin(base_path, self.data_dir) if self.data_dir else base_path
219222
self.data_files = self.data_files.resolve(base_path, download_config)
220223

221224

src/datasets/load.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ def load_dataset_builder(
22402240
else:
22412241
builder_config = None
22422242
if builder_config and builder_config.data_files is not None:
2243-
builder_config._resolve_data_files(base_path=builder_kwargs["base_path"], download_config=download_config)
2243+
builder_config._resolve_data_files(base_path=builder_kwargs.get("base_path"), download_config=download_config)
22442244
hash = update_hash_for_cache(hash, data_files=builder_config.data_files)
22452245
# Instantiate the dataset builder
22462246
builder_instance: DatasetBuilder = builder_cls(

0 commit comments

Comments
 (0)