Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 483e6ae

Browse files
committed
Create pipeline instance when creating the SequentialPipelineProcessor not for every process
1 parent 0c09b9e commit 483e6ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/codegate/pipeline/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,9 @@ def __init__(
338338
self.pipeline_steps = pipeline_steps
339339
self.secret_manager = secret_manager
340340
self.is_fim = is_fim
341+
self.instance = self._create_instance()
341342

342-
def create_instance(self) -> InputPipelineInstance:
343+
def _create_instance(self) -> InputPipelineInstance:
343344
"""Create a new pipeline instance for processing a request"""
344345
return InputPipelineInstance(self.pipeline_steps, self.secret_manager, self.is_fim)
345346

@@ -354,7 +355,6 @@ async def process_request(
354355
is_copilot: bool = False,
355356
) -> PipelineResult:
356357
"""Create a new pipeline instance and process the request"""
357-
instance = self.create_instance()
358-
return await instance.process_request(
358+
return await self.instance.process_request(
359359
request, provider, model, api_key, api_base, extra_headers, is_copilot
360360
)

0 commit comments

Comments
 (0)