Skip to content

Commit 62e501a

Browse files
committed
💡 Add comments describing the issue with preprocess request
Signed-off-by: Gaurav-Kumbhat <Gaurav.Kumbhat@ibm.com>
1 parent 33956d8 commit 62e501a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

vllm_detector_adapter/generative_detectors/granite_guardian.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ class GraniteGuardian(ChatCompletionDetectionBase):
3535
PROMPT_CONTEXT_ANALYSIS_RISKS = ["context_relevance"]
3636
RESPONSE_CONTEXT_ANALYSIS_RISKS = ["groundedness"]
3737

38-
def __init__(self, *args, **kwargs):
39-
super().__init__(*args, **kwargs)
40-
4138
##### Private / Internal functions ###################################################
4239

4340
def __preprocess(
@@ -149,6 +146,11 @@ def _request_to_chat_completion_request(
149146

150147
@detector_dispatcher(types=[DetectorType.TEXT_CONTENT])
151148
def preprocess_request(self, *args, **kwargs):
149+
# FIXME: This function delcaration is temporary and should be removed once we fix following
150+
# issue with decorator:
151+
# ISSUE: Because of inheritance, the base class function with same name gets overriden by the function
152+
# declared below for preprocessing TEXT_CHAT type detectors. This fails the validation inside
153+
# the detector_dispatcher decorator.
152154
return super().preprocess_request(
153155
*args, **kwargs, fn_type=DetectorType.TEXT_CONTENT
154156
)

0 commit comments

Comments
 (0)