Skip to content

AttributeError: 'DatasetDict' object has no attribute 'train_test_split' #1600

Description

@david-waterworth

The following code fails with "'DatasetDict' object has no attribute 'train_test_split'" - am I doing something wrong?

from datasets import load_dataset
dataset = load_dataset('csv', data_files='data.txt')
dataset = dataset.train_test_split(test_size=0.1)

AttributeError: 'DatasetDict' object has no attribute 'train_test_split'

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions