Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
medianFilter()reflects an out-of-range index only once. When the window is wider than a short input, the reflected index can still be outside the array: singleton floating-point inputs produceNaN, wider windows produce incorrect medians, and BigInt typed arrays throw. Whisper timestamp alignment also uses this helper.Use periodic reflection to keep every sample index in range, and return a distinct copy for empty or singleton inputs. This preserves the input typed-array constructor, existing window validation, and the in-range fast path.
Added regression coverage for singleton and two-element inputs, oversized windows across floating-point, integer, and BigInt typed arrays, empty inputs, and unit windows.
Validation:
@huggingface/transformerstest suite (pnpm test --runInBand): all 27 suites passed, 2,227 tests passed, 47 skipped. Assertions and timeouts were unchanged; run with Node 24 andNODE_USE_ENV_PROXY=1to use the configured network proxy.pnpm buildpassed for both packages, including declaration generation.git diff --checkpassed. The root format check reports only the unchangedtensor.test.jsandtensor_ops.test.jsfiles.No JSDoc or generated documentation changes. This patch was prepared with AI assistance; the diff and validation results were reviewed before submission.