Refactor LLM processor and improve async handling
Move contextual information handling from noise filtering to extraction and centralize LLM call logic. Wrap blocking transcription and state update calls in asyncio.to_thread to prevent event loop blocking. Update transcriber model size to base.
This commit is contained in:
@@ -44,7 +44,7 @@ class PipelineOrchestrator:
|
||||
|
||||
# Modules
|
||||
self.listener = AudioListener(loop=self.loop)
|
||||
self.transcriber = Transcriber(model_size="small")
|
||||
self.transcriber = Transcriber(model_size="base")
|
||||
self.processor = LLMProcessor()
|
||||
self.rag_manager = RAGManager()
|
||||
|
||||
@@ -107,7 +107,9 @@ class PipelineOrchestrator:
|
||||
full_audio = np.concatenate(self.audio_buffer)
|
||||
|
||||
# Transcribe (WhisperX now returns a list of (speaker, text, start, end))
|
||||
results = self.transcriber.transcribe(full_audio)
|
||||
results = await asyncio.to_thread(
|
||||
self.transcriber.transcribe, full_audio
|
||||
)
|
||||
|
||||
# Filter for only new segments that start after the last processed segment
|
||||
new_segments = [
|
||||
|
||||
Reference in New Issue
Block a user