Skip to content

Include trust_remote_code flag for code-based HF builders preparation. #5549

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def __init__(
tfds_num_proc: Optional[int] = None,
ignore_hf_errors: bool = False,
overwrite_version: str | None = None,
trust_remote_code: bool = False,
**config_kwargs,
):
self._hf_repo_id = hf_repo_id
Expand All @@ -210,7 +211,10 @@ def __init__(
)
try:
self._hf_builder = hf_datasets.load_dataset_builder(
self._hf_repo_id, self._hf_config, **self.config_kwargs
self._hf_repo_id,
self._hf_config,
trust_remote_code=trust_remote_code,
**self.config_kwargs,
)
except Exception as e:
raise RuntimeError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def mock_huggingface_dataset_builder(
other_arg='this is another arg',
)
load_dataset_builder.assert_called_once_with(
'foo/bar', 'config', other_arg='this is another arg'
'foo/bar',
'config',
other_arg='this is another arg',
trust_remote_code=False,
)
login_to_hf.assert_called_once_with('SECRET_TOKEN')
yield builder
Expand Down
Loading