Skip to content

Fix typo in WerMetric: use hyp_seqs instead of ref_seqs for hyp_seqs_list#1506

Merged
cirquit merged 1 commit intofacebookresearch:mainfrom
beckybyte:fix/wer-hyp-seqs-typo
Apr 6, 2026
Merged

Fix typo in WerMetric: use hyp_seqs instead of ref_seqs for hyp_seqs_list#1506
cirquit merged 1 commit intofacebookresearch:mainfrom
beckybyte:fix/wer-hyp-seqs-typo

Conversation

@beckybyte
Copy link
Copy Markdown
Contributor

@beckybyte beckybyte commented Apr 4, 2026

What does this PR do? Please describe:
Fix a typo in WerMetric.update() where hyp_seqs_list was incorrectly assigned from ref_seqs.cpu().tolist() instead of hyp_seqs.cpu().tolist(). This caused the unit-level edit distance to always compare reference sequences against themselves, making UER always 0 regardless of actual model output.

Does your PR introduce any breaking changes? If yes, please list them:
No breaking changes.

Check list:

  • Was the content of this PR discussed and approved via a GitHub issue? (no need for typos or documentation improvements)
  • Did you read the contributor guideline?
  • Did you make sure that your PR does only one thing instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (no need for typos, documentation, or minor internal changes)

…list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 4, 2026 20:32
@beckybyte beckybyte requested a review from zyaoj as a code owner April 4, 2026 20:32
@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Apr 4, 2026

Hi @beckybyte!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a logic bug in the WerMetric.update() implementation so that unit-level edit distance (UER) is computed against the hypothesis token sequences rather than accidentally comparing references against themselves.

Changes:

  • Correct hyp_seqs_list to be derived from hyp_seqs (instead of ref_seqs) before computing edit distance.

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

@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Apr 4, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 4, 2026
@cirquit
Copy link
Copy Markdown
Contributor

cirquit commented Apr 6, 2026

Thanks for the finding this bug and for the contribution!

@cirquit cirquit merged commit 8061d51 into facebookresearch:main Apr 6, 2026
17 of 19 checks passed
@beckybyte beckybyte deleted the fix/wer-hyp-seqs-typo branch April 6, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants