Skip to content

Commit

Permalink
Fix ci (#7028)
Browse files Browse the repository at this point in the history
fix ci
  • Loading branch information
lhoestq authored Jul 4, 2024
1 parent cc6ac9e commit 689447f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/datasets/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def increase_load_count(name: str):

def _download_additional_modules(
name: str, base_path: str, imports: Tuple[str, str, str, str], download_config: Optional[DownloadConfig]
) -> List[Tuple[str, str]]:
) -> Tuple[List[Tuple[str, str]], List[Tuple[str, str]]]:
"""
Download additional module for a module <name>.py at URL (or local path) <base_path>/<name>.py
The imports must have been parsed first using ``get_imports``.
Expand Down Expand Up @@ -324,7 +324,7 @@ def _download_additional_modules(
local_import_path = os.path.join(local_import_path, sub_directory)
local_imports.append((import_name, local_import_path))

return local_imports
return local_imports, library_imports


def _check_library_imports(name: str, library_imports: List[Tuple[str, str]]) -> None:
Expand Down Expand Up @@ -725,7 +725,7 @@ def get_module(self) -> DatasetModule:
dataset_infos_path = Path(self.path).parent / config.DATASETDICT_INFOS_FILENAME
dataset_readme_path = Path(self.path).parent / config.REPOCARD_FILENAME
imports = get_imports(self.path)
local_imports = _download_additional_modules(
local_imports, library_imports = _download_additional_modules(
name=self.name,
base_path=str(Path(self.path).parent),
imports=imports,
Expand Down Expand Up @@ -764,7 +764,7 @@ def get_module(self) -> DatasetModule:
" repo on your local machine. Make sure you have read the code there to avoid malicious use, then"
" set the option `trust_remote_code=True` to remove this error."
)
_check_library_imports(name=self.name, local_imports=local_imports)
_check_library_imports(name=self.name, library_imports=library_imports)
module_path, hash = _load_importable_file(
dynamic_modules_path=dynamic_modules_path,
module_namespace="datasets",
Expand Down Expand Up @@ -1289,7 +1289,7 @@ def get_module(self) -> DatasetModule:
dataset_infos_path = self.download_dataset_infos_file()
dataset_readme_path = self.download_dataset_readme_file()
imports = get_imports(local_path)
local_imports = _download_additional_modules(
local_imports, library_imports = _download_additional_modules(
name=self.name,
base_path=hf_dataset_url(self.name, "", revision=self.revision),
imports=imports,
Expand Down Expand Up @@ -1328,7 +1328,7 @@ def get_module(self) -> DatasetModule:
" repo on your local machine. Make sure you have read the code there to avoid malicious use, then"
" set the option `trust_remote_code=True` to remove this error."
)
_check_library_imports(name=self.name, local_imports=local_imports)
_check_library_imports(name=self.name, library_imports=library_imports)
module_path, hash = _load_importable_file(
dynamic_modules_path=dynamic_modules_path,
module_namespace="datasets",
Expand Down

0 comments on commit 689447f

Please sign in to comment.