Skip to content

Commit

Permalink
Revert to before the typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
metropol committed Mar 4, 2024
1 parent b593514 commit 34e26bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Examples/WhisperAX/WhisperAX/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ struct ContentView: View {
try await whisperKit.loadModels()

await MainActor.run {
availableLanguages = whisperKit.tokenizer?.languages.map { $0.key }.sorted() ?? ["english"]
availableLanguages = whisperKit.tokenizer?.langauges.map { $0.key }.sorted() ?? ["english"]
loadingProgressValue = 1.0
modelState = whisperKit.modelState
}
Expand Down Expand Up @@ -920,7 +920,7 @@ struct ContentView: View {
func transcribeAudioSamples(_ samples: [Float]) async throws -> TranscriptionResult? {
guard let whisperKit = whisperKit else { return nil }

let languageCode = whisperKit.tokenizer?.languages[selectedLanguage] ?? "en"
let languageCode = whisperKit.tokenizer?.langauges[selectedLanguage] ?? "en"
let task: DecodingTask = selectedTask == "transcribe" ? .transcribe : .translate
let seekClip = [lastConfirmedSegmentEndSeconds]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ struct WhisperAXWatchView: View {
try await whisperKit.loadModels()

await MainActor.run {
availableLanguages = whisperKit.tokenizer?.languages.map { $0.key }.sorted() ?? ["english"]
availableLanguages = whisperKit.tokenizer?.langauges.map { $0.key }.sorted() ?? ["english"]
loadingProgressValue = 1.0
modelState = whisperKit.modelState
}
Expand Down Expand Up @@ -491,7 +491,7 @@ struct WhisperAXWatchView: View {
func transcribeAudioSamples(_ samples: [Float]) async throws -> TranscriptionResult? {
guard let whisperKit = whisperKit else { return nil }

let languageCode = whisperKit.tokenizer?.languages[selectedLanguage] ?? "en"
let languageCode = whisperKit.tokenizer?.langauges[selectedLanguage] ?? "en"
let task: DecodingTask = selectedTask == "transcribe" ? .transcribe : .translate
let seekClip = [lastConfirmedSegmentEndSeconds]

Expand Down
2 changes: 1 addition & 1 deletion Sources/WhisperKit/Core/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ public extension Tokenizer {
return false
}

var languages: [String: String] { [
var langauges: [String: String] { [
"english": "en",
"chinese": "zh",
"german": "de",
Expand Down

0 comments on commit 34e26bc

Please sign in to comment.