feat: WhisperKit transcriber biases decoding with vocabulary prompt tokens
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user