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

Update validation to allow for empty context lists #879

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

Conversation

LogicalShark
Copy link

When no strings are provided in the contexts during evaluation, the context feature's type in the dataset is the generic Sequence type rather than the expected Sequence[string], thus it fails validation with a ValueError, despite being a valid dataset.

For example, if retrieval uses an unrealistically high similarity score threshold, no contexts will be found, but the error message will be the unhelpful and irrelevant ValueError: Dataset feature "contexts" should be of type Sequence[string], got <class 'datasets.features.features.Sequence'>.

See also #286

When no strings are provided in the contexts during evaluation, the context feature's type in the dataset is the generic Sequence type rather than the expected Sequence[string], thus it fails validation with a ValueError, despite being a valid dataset.

For example, if retrieval uses an unrealistically high similarity score threshold, no contexts will be found, but the error message will be the unhelpful and irrelevant `ValueError: Dataset feature "contexts" should be of type Sequence[string], got <class 'datasets.features.features.Sequence'>`.
@shahules786
Copy link
Member

Hey @LogicalShark thanks for the PR, looks good.

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

2 participants