Skip to content

Comments

fix: read beam.search_type from config instead of hardcoding 'default'#15402

Open
nedalaltiti wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
nedalaltiti:fix/ctc-beam-search-type-hardcoded
Open

fix: read beam.search_type from config instead of hardcoding 'default'#15402
nedalaltiti wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
nedalaltiti:fix/ctc-beam-search-type-hardcoded

Conversation

@nedalaltiti
Copy link

@nedalaltiti nedalaltiti commented Feb 16, 2026

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Fixes CTC beam decoding configuration by reading beam.search_type from the decoding config instead of hardcoding search_type="default" when strategy="beam" in AbstractCTCDecoding.__init__.

This enables intended behavior for LM-aware beam search backends (e.g., pyctcdecode) when users set beam.search_type and provide kenlm_path.

Collection: [ASR]

Changelog

  • Update AbstractCTCDecoding.__init__ to pass:

    • from search_type="default"
    • to search_type=self.cfg.beam.get("search_type", "default")
  • Keeps backward compatibility via the "default" fallback when beam.search_type is not set.

Usage

from omegaconf import OmegaConf

ctc_cfg = OmegaConf.create({
    "strategy": "beam",
    "beam": {
        "beam_size": 32,
        "search_type": "pyctcdecode",
        "kenlm_path": "/path/to/lm.arpa",
        "beam_alpha": 0.5,
        "beam_beta": 0.1,
    },
})

model.change_decoding_strategy(decoding_cfg=ctc_cfg, decoder_type="ctc")

# After this fix, the configured search_type is preserved
assert model.ctc_decoding.decoding.search_type == "pyctcdecode"

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

PR Type:

  • New Feature
  • Bugfix
  • Documentation

Additional Information

Diff summary:

  • search_type="default"
  • search_type=self.cfg.beam.get("search_type", "default")

Reviewer: @nithinraok

@github-actions github-actions bot added the ASR label Feb 16, 2026
Signed-off-by: nedalaltiti <nedal.altiti@live.com>
@nedalaltiti nedalaltiti force-pushed the fix/ctc-beam-search-type-hardcoded branch from 02531a5 to 07f049f Compare February 16, 2026 10:37
@nedalaltiti
Copy link
Author

Hi @nithinraok, could you please add the Run CICD label to trigger the CI tests? Also requesting your review on this ASR fix.

Note: The reformat_with_isort_and_black check failure is a CI infrastructure issue — the changed-files action cannot resolve fork commit SHAs with pull_request_target. It is unrelated to this code change. Happy to rebase or adjust if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants