Skip to content
Open
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 @@ -147,6 +147,12 @@ def analyze(files_or_archives, downloaded_files_or_dirs, split):
if self.config.drop_labels is None
else not self.config.drop_labels
)

if add_labels and labels:
common_split_names = {"train", "training", "test", "testing", "val", "valid", "validation", "dev", "eval"}
split_names = set(data_files.keys())
if labels.issubset(common_split_names | split_names):
add_labels = False

if add_labels:
logger.info("Adding the labels inferred from data directories to the dataset's features...")
Expand Down