feat: WhisperKit transcriber biases decoding with vocabulary prompt tokens

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 15:03:04 +02:00
co-authored by Claude Sonnet 5.5
parent c8e16145e1
commit af1acdc0fa
4 changed files with 69 additions and 2 deletions
+4 -1
View File
@@ -25,8 +25,11 @@ func runTranscribeProbe() async {
}
print("RMS per seconde:", perSecond.joined(separator: " "))
do {
let vocabulary = (ProcessInfo.processInfo.environment["SST_VOCAB"] ?? "")
.split(separator: ",").map { $0.trimmingCharacters(in: .whitespaces) }.filter { !$0.isEmpty }
if !vocabulary.isEmpty { print("voorrang: \(vocabulary.joined(separator: ", "))") }
let started = Date.now
let text = try await transcriber.transcribe(samples)
let text = try await transcriber.transcribe(samples, vocabulary: vocabulary)
let elapsed = Date.now.timeIntervalSince(started)
print(String(format: "(%.2f s) ", elapsed) + text)
} catch {