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

warn supported dataset checks instead of throw #260

Merged
merged 2 commits into from
Apr 24, 2024
Merged
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
12 changes: 7 additions & 5 deletions torchtitan/datasets/hf_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ def __init__(
rank: int = 0,
infinite: bool = False,
) -> None:
if dataset_name not in _supported_datasets:
raise ValueError(
f"Dataset {dataset_name} is not supported. "
f"Supported datasets are: {_supported_datasets.keys()}."
)
# special case to auto-load c4_mini (and any future datasets) from local dir
if dataset_name == "c4_mini":
dataset_path = f"torchtitan/datasets/{dataset_name}"
Expand All @@ -84,6 +79,13 @@ def __init__(
logger.info(f"Preparing {dataset_name} dataset from HuggingFace")
# Setting `streaming=True` works for large dataset, but is slightly
# slower and unstable.
if dataset_name not in _supported_datasets:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite right because of L99. I think we can & should only bypass the check when dataset_path is specified.

import warnings

warnings.warn(
f"Dataset {dataset_name} is not tested/verfied. "
f"Recommended datasets are: {_supported_datasets.keys()}."
)
if dataset_name == "c4":
# c4 is huge, and requires both streaming and language selection
# (we default to en).
Expand Down
Loading