Pipeline: improve performance by using direct mode

This commit is contained in:
Aleix Conchillo Flaqué
2025-08-14 15:15:47 -07:00
parent 609a43a191
commit dc7bf98ce5
3 changed files with 7 additions and 3 deletions

View File

@@ -38,6 +38,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed an issue where `AsyncAITTSService` had very high latency in responding - Fixed an issue where `AsyncAITTSService` had very high latency in responding
by adding `force=true` when sending the flush command. by adding `force=true` when sending the flush command.
### Performance
- `Pipeline` performance improvements by using direct mode.
### Other ### Other
- Added `14w-function-calling-mistal.py` using `MistralLLMService`. - Added `14w-function-calling-mistal.py` using `MistralLLMService`.

View File

@@ -19,9 +19,9 @@ class BasePipeline(FrameProcessor):
metrics collection from their contained processors. metrics collection from their contained processors.
""" """
def __init__(self): def __init__(self, **kwargs):
"""Initialize the base pipeline.""" """Initialize the base pipeline."""
super().__init__() super().__init__(**kwargs)
@abstractmethod @abstractmethod
def processors_with_metrics(self) -> List[FrameProcessor]: def processors_with_metrics(self) -> List[FrameProcessor]:

View File

@@ -98,7 +98,7 @@ class Pipeline(BasePipeline):
Args: Args:
processors: List of frame processors to connect in sequence. processors: List of frame processors to connect in sequence.
""" """
super().__init__() super().__init__(enable_direct_mode=True)
# Add a source and a sink queue so we can forward frames upstream and # Add a source and a sink queue so we can forward frames upstream and
# downstream outside of the pipeline. # downstream outside of the pipeline.