Skip to content

Fix typo in suppressTokens variable name across multiple files #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/WhisperKit/Core/Configurations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ open class WhisperKitConfig {
/// - promptTokens: Array of token IDs to use as the conditioning prompt for the decoder. These are prepended to the prefill tokens.
/// - prefixTokens: Array of token IDs to use as the initial prefix for the decoder. These are appended to the prefill tokens.
/// - suppressBlank: If true, blank tokens will be suppressed during decoding.
/// - supressTokens: List of token IDs to suppress during decoding.
/// - suppressTokens: List of token IDs to suppress during decoding.
/// - compressionRatioThreshold: If the compression ratio of the transcription text is above this value, it is too repetitive and treated as failed.
/// - logProbThreshold: If the average log probability over sampled tokens is below this value, treat as failed.
/// - firstTokenLogProbThreshold: If the log probability over the first sampled token is below this value, treat as failed.
Expand All @@ -145,7 +145,7 @@ public struct DecodingOptions: Codable {
public var promptTokens: [Int]?
public var prefixTokens: [Int]?
public var suppressBlank: Bool
public var supressTokens: [Int]
public var suppressTokens: [Int]
public var compressionRatioThreshold: Float?
public var logProbThreshold: Float?
public var firstTokenLogProbThreshold: Float?
Expand Down Expand Up @@ -173,7 +173,7 @@ public struct DecodingOptions: Codable {
promptTokens: [Int]? = nil,
prefixTokens: [Int]? = nil,
suppressBlank: Bool = false,
supressTokens: [Int]? = nil,
suppressTokens: [Int]? = nil,
compressionRatioThreshold: Float? = 2.4,
logProbThreshold: Float? = -1.0,
firstTokenLogProbThreshold: Float? = -1.5,
Expand All @@ -200,7 +200,7 @@ public struct DecodingOptions: Codable {
self.promptTokens = promptTokens
self.prefixTokens = prefixTokens
self.suppressBlank = suppressBlank
self.supressTokens = supressTokens ?? [] // nonSpeechTokens() // TODO: implement these as default
self.suppressTokens = suppressTokens ?? [] // nonSpeechTokens() // TODO: implement these as default
self.compressionRatioThreshold = compressionRatioThreshold
self.logProbThreshold = logProbThreshold
self.firstTokenLogProbThreshold = firstTokenLogProbThreshold
Expand Down
4 changes: 2 additions & 2 deletions Sources/WhisperKit/Core/TextDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,8 @@ open class TextDecoder: TextDecoding, WhisperMLModel {
)
}

if !options.supressTokens.isEmpty {
logitsFilters.append(SuppressTokensFilter(suppressTokens: options.supressTokens))
if !options.suppressTokens.isEmpty {
logitsFilters.append(SuppressTokensFilter(suppressTokens: options.suppressTokens))
}

if !options.withoutTimestamps {
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhisperKitCLI/CLIArguments.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct CLIArguments: ParsableArguments {
var clipTimestamps: [Float] = []

@Option(parsing: .upToNextOption, help: "List of tokens to supress in the output (example: --supress-tokens 1 2 3)")
var supressTokens: [Int] = []
var suppressTokens: [Int] = []

@Option(help: "Gzip compression ratio threshold for decoding failure")
var compressionRatioThreshold: Float?
Expand Down
2 changes: 1 addition & 1 deletion Sources/WhisperKitCLI/TranscribeCLI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ struct TranscribeCLI: AsyncParsableCommand {
withoutTimestamps: cliArguments.withoutTimestamps,
wordTimestamps: cliArguments.wordTimestamps || cliArguments.streamSimulated,
clipTimestamps: cliArguments.clipTimestamps,
supressTokens: cliArguments.supressTokens,
suppressTokens: cliArguments.suppressTokens,
compressionRatioThreshold: cliArguments.compressionRatioThreshold ?? 2.4,
logProbThreshold: cliArguments.logprobThreshold ?? -1.0,
firstTokenLogProbThreshold: cliArguments.firstTokenLogProbThreshold,
Expand Down