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

Dataset load for benchmarking #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LuvvAggarwal
Copy link

Added a utility for loading dataset from hugging face

Added a utility for loading dataset from hugging face
@CLAassistant
Copy link

CLAassistant commented Aug 14, 2023

CLA assistant check
All committers have signed the CLA.

@LuvvAggarwal LuvvAggarwal mentioned this pull request Aug 14, 2023
@LuvvAggarwal LuvvAggarwal marked this pull request as ready for review August 15, 2023 10:25
@HashemAlsaket
Copy link
Contributor

Awesome work @LuvvAggarwal . Could you add an example with the changes added from PR #72 for review?

@@ -0,0 +1,44 @@
from datasets import load_dataset_builder,load_dataset,get_dataset_config_names, Dataset
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll want to guard prompttools from requiring datasets to be installed as part of the requirements.

Suggested change:

try:
    from datasets import load_dataset_builder, load_dataset, get_dataset_config_names, Dataset
    from datasets.dataset_dict import DatasetDict
except ImportError:
    load_dataset = None

dataset_name: str,
split: Literal["train","validation","test"] | None
):
self.dataset_name = dataset_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change:

if load_dataset is None:
            raise ModuleNotFoundError(
                "Package `datasets` is required to be installed to use this experiment."
                "Please use `pip install datasets` to install the package"
            )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants