Fix decoder state cleanup blocking transcription start with Parakeet model
This commit is contained in:
parent
d1f603b5e6
commit
9e29b34db1
@ -71,9 +71,6 @@ class ParakeetTranscriptionService: TranscriptionService {
|
||||
throw ASRError.notInitialized
|
||||
}
|
||||
|
||||
// Reset the decoder state before each transcription to ensure no state leaks from previous runs
|
||||
try await asrManager.resetDecoderState(for: .microphone)
|
||||
|
||||
let audioSamples = try readAudioSamples(from: audioURL)
|
||||
|
||||
// Validate audio data before transcription
|
||||
@ -84,7 +81,9 @@ class ParakeetTranscriptionService: TranscriptionService {
|
||||
|
||||
let result = try await asrManager.transcribe(audioSamples)
|
||||
|
||||
// Reset decoder state and cleanup after transcription to avoid blocking the transcription start
|
||||
Task {
|
||||
try? await asrManager.resetDecoderState(for: .microphone)
|
||||
asrManager.cleanup()
|
||||
isModelLoaded = false
|
||||
logger.notice("🦜 Parakeet ASR models cleaned up from memory")
|
||||
|
||||
@ -51,7 +51,7 @@ struct MetricsContent: View {
|
||||
color: .green
|
||||
)
|
||||
MetricCard(
|
||||
title: "WPM",
|
||||
title: "Average Words/Minute",
|
||||
value: String(format: "%.1f", averageWordsPerMinute),
|
||||
icon: "speedometer",
|
||||
color: .orange
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user