Skip to content

[Fix] run_pseudo_labelling: KeyError on dotted split name like train.360 (#96) - #172

Open
yushuosun wants to merge 1 commit into
huggingface:mainfrom
yushuosun:fix/pseudo-labelling-split-key
Open

[Fix] run_pseudo_labelling: KeyError on dotted split name like train.360 (#96)#172
yushuosun wants to merge 1 commit into
huggingface:mainfrom
yushuosun:fix/pseudo-labelling-split-key

Conversation

@yushuosun

Copy link
Copy Markdown

Motivation

Pseudo-labelling a dataset whose split name contains a dot (e.g. librispeech_asr train.360) crashes with KeyError: 'train-360' in the non-streaming path (#96).

Root cause

In training/run_pseudo_labelling.py, eval_step_with_save(split) receives the original split name (train.360), and raw_datasets / vectorized_datasets / file_ids_dataset are all keyed by that original name. But line 886 rebinds the variable:

split = split.replace(".", "-").split("/")[-1]   # "train.360" -> "train-360"

so the later non-streaming post-processing (raw_datasets[split].add_column(...)) looks up train-360, which doesn't exist → KeyError.

Modifications

training/run_pseudo_labelling.py: introduce a separate pretty_split for the output CSV filename and leave split as the original dataset key, so all raw_datasets[split] accesses resolve correctly.

Duplicate-check

…ing)

eval_step_with_save(split) is called with the original split name (e.g.
"train.360"), and raw_datasets is keyed by that name. Line 886 rebound
`split = split.replace(".", "-").split("/")[-1]` ("train-360"), so the later
non-streaming raw_datasets[split] access raised KeyError. Use a separate
pretty_split for the output filename and keep `split` as the original key.
Copilot AI review requested due to automatic review settings June 28, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes a crash in run_pseudo_labelling when dataset split names contain dots (e.g. train.360) in the non-streaming path by ensuring the dataset-key split name is not mutated while still producing a filesystem-friendly output filename.

Changes:

  • Stop rebinding split (dataset key) and instead introduce pretty_split for CSV output naming.
  • Ensure downstream non-streaming post-processing continues to index raw_datasets[...] with the original split key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants