Skip to content
Merged
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/FluidAudio/ASR/Parakeet/AsrManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public actor AsrManager {

sampleSource.cleanup()

try await self.resetDecoderState()
try await self.resetDecoderState(for: source)
if shouldEmitProgress {
await progressEmitter.finishSession()
}
Expand Down Expand Up @@ -432,9 +432,9 @@ public actor AsrManager {
do {
let result = try await transcribeWithState(audioSamples, source: source)

// Stateless architecture: reset decoder state after each transcription to ensure
// independent processing for batch operations without state carryover
try await self.resetDecoderState()
// Reset only the source we just used — resetting both races with a
// concurrent transcription on the other source and frees in-flight MLMultiArrays.
try await self.resetDecoderState(for: source)
if shouldEmitProgress {
await progressEmitter.finishSession()
}
Expand Down
Loading