fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

Update data_cfg.py

Open ajkpix opened this issue 5 months ago • 1 comments

add @property to def standardize_audio(self) -> bool

What does this PR do?

Here is a bug with the function. when we call self.cfg.standardize_audio, it always return true. see https://github.com/facebookresearch/fairseq/blob/main/fairseq/data/audio/speech_to_text_dataset.py#L244-L248

if self.cfg.use_audio_input:
    source = torch.from_numpy(source).float()
    if self.cfg.standardize_audio:
        with torch.no_grad():
            source = F.layer_norm(source, source.shape)

I think the function need a @property.

ajkpix avatar Jun 23 '25 06:06 ajkpix