Skip to content

Commit 0abd6ad

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: Preprend question tag to rubric critiquing response after editing the predefined prompts to end with <question> to avoid parsing errors
PiperOrigin-RevId: 743653376
1 parent 1589f66 commit 0abd6ad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vertexai/preview/evaluation/utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,8 @@ def parse_question(txt: str):
593593

594594
def parse_question_blocks(txt: str) -> List[Tuple[str, bool]]:
595595
"""Parses the question blocks from the rubric critique response."""
596+
if not txt.startswith("<question>\n"):
597+
txt = "<question>\n" + txt
596598
responses = []
597599
question_blocks = _QUESTION_BLOCK_REGEX.findall(txt)
598600
if not question_blocks:

0 commit comments

Comments
 (0)