Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant prepare_module #2597

Merged
merged 2 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/datasets/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ def as_streaming_dataset(
from .utils.streaming_download_manager import StreamingDownloadManager

dl_manager = StreamingDownloadManager(
base_path=base_path,
base_path=base_path or self.base_path,
download_config=DownloadConfig(use_auth_token=use_auth_token),
dataset_name=self.name,
data_dir=self.config.data_dir,
Expand Down
17 changes: 1 addition & 16 deletions src/datasets/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,20 +808,6 @@ def load_dataset(
f"using 'pip install datasets[streaming]' or 'pip install aiohttp' for instance"
)
# Download/copy dataset processing script
module_path, hash, resolved_file_path = prepare_module(
path,
script_version=script_version,
download_config=download_config,
download_mode=download_mode,
dataset=True,
return_resolved_file_path=True,
use_auth_token=use_auth_token,
)
# Set the base path for downloads as the parent of the script location
if resolved_file_path is not None:
base_path = url_or_path_parent(resolved_file_path)
else:
base_path = None

# Create a dataset builder
builder_instance = load_dataset_builder(
Expand All @@ -841,10 +827,9 @@ def load_dataset(
# Retturn iterable dataset in case of streaming
if streaming:
# this extends the open and os.path.join functions for data streaming
extend_module_for_streaming(module_path, use_auth_token=use_auth_token)
extend_module_for_streaming(builder_instance.__module__, use_auth_token=use_auth_token)
return builder_instance.as_streaming_dataset(
split=split,
base_path=base_path,
use_auth_token=use_auth_token,
)

Expand Down