Skip to content

Commit

Permalink
Reset shoudlEarlyStop as an instance property of TextDecoder and up…
Browse files Browse the repository at this point in the history
…date tests
  • Loading branch information
ZachNagengast committed May 25, 2024
1 parent 302fc8c commit 3aa94e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/WhisperKit/Core/TextDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ open class TextDecoder: TextDecoding, WhisperMLModel {
Logging.debug("Running main loop for a maximum of \(loopCount) iterations, starting at index \(prefilledIndex)")
var hasAlignment = false
var isFirstTokenLogProbTooLow = false
var shouldEarlyStop = false
shouldEarlyStop = false
for tokenIndex in prefilledIndex..<loopCount {
let loopStart = Date()

Expand Down
2 changes: 1 addition & 1 deletion Tests/WhisperKitTests/UnitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ final class UnitTests: XCTestCase {
XCTAssertEqual(decodingTimePerTokenWithWait, decodingTimePerToken, accuracy: decodingTimePerToken * 0.75, "Decoding predictions per token should not be significantly slower with waiting")

// Assert that more tokens are returned in the callback with waiting
XCTAssertGreaterThanOrEqual(tokenCountWithWait, tokenCount, "More tokens should be returned in the callback with waiting")
XCTAssertGreaterThan(tokenCountWithWait, tokenCount, "More tokens should be returned in the callback with waiting")
}

// MARK: - Tokenizer Tests
Expand Down

0 comments on commit 3aa94e8

Please sign in to comment.