Skip to content

Fix black formatting in europarl_st beam_search.py#2098

Merged
csukuangfj merged 1 commit into
k2-fsa:masterfrom
HenryVarro666:fix-europarl-style
Jul 13, 2026
Merged

Fix black formatting in europarl_st beam_search.py#2098
csukuangfj merged 1 commit into
k2-fsa:masterfrom
HenryVarro666:fix-europarl-style

Conversation

@HenryVarro666

@HenryVarro666 HenryVarro666 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

egs/europarl_st/SRT/lcma_srt/beam_search.py (added in #2096) fails the style_check workflow — black 22.3.0 wants to reformat it, so style_check is currently red for every PR (e.g. it's what fails on #2097, whose change is an unrelated shell script).

Reformatted with the exact versions the workflow installs (black==22.3.0, click==8.1.0); black --check and isort --check both pass on the file now. No functional change (+3/-1).

Summary by CodeRabbit

  • Bug Fixes
    • Improved the error message shown when an invalid language token ID is provided during beam search.
    • Clarified that the language token ID must be an integer.

egs/europarl_st/SRT/lcma_srt/beam_search.py (added in k2-fsa#2096) fails the
style_check workflow: black 22.3.0 wants to reformat it, which currently
turns style_check red for every PR. Reformatted with the same black
version CI uses.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request reformats a long line in egs/europarl_st/SRT/lcma_srt/beam_search.py where a TypeError is raised, breaking it into multiple lines to improve code readability. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a629cfb6-fbcc-40ec-8723-d5e53b20fa4a

📥 Commits

Reviewing files that changed from the base of the PR and between f9b40b0 and b55002e.

📒 Files selected for processing (1)
  • egs/europarl_st/SRT/lcma_srt/beam_search.py

📝 Walkthrough

Walkthrough

The pull request reformats the TypeError message raised when lang_token_id is not an integer during forced first-language beam search validation.

Changes

Beam search validation

Layer / File(s) Summary
TypeError message formatting
egs/europarl_st/SRT/lcma_srt/beam_search.py
The invalid lang_token_id validation retains its behavior and updates the exception message formatting.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: linanjie0820

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: reformatting the europarl_st beam_search file with Black.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@HenryVarro666

Copy link
Copy Markdown
Contributor Author

Heads up for reviewers: the red CI here is unrelated to this PR, which is a formatting-only change to europarl_st/beam_search.py. The failures come from pre-existing environment issues on master — the shared test tree aborts during pytest collection with ModuleNotFoundError: No module named 'kaldi_native_fbank' (from test_rknn_on_cpu_simulator_ctc_streaming.py), and the rknn workflow fails for the same missing dependency. None of the failing jobs touch the file changed here. Happy to help fix the CI dependency separately if useful.

@csukuangfj csukuangfj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for your contribution!

@csukuangfj csukuangfj merged commit 0a9a404 into k2-fsa:master Jul 13, 2026
97 of 128 checks passed
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