Skip to content

Commit

Permalink
update: search by match (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdiazlor authored Jan 14, 2025
1 parent 9506930 commit e866345
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/distilabel/steps/tasks/complexity_scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def format_output(
scores = []
score_lines = output.split("\n")
for i, line in enumerate(score_lines):
match = _PARSE_SCORE_LINE_REGEX.match(line)
match = _PARSE_SCORE_LINE_REGEX.search(line)
score = float(match.group(1)) if match else None
scores.append(score)
if i == len(input["instructions"]) - 1:
Expand Down
2 changes: 1 addition & 1 deletion src/distilabel/steps/tasks/sentence_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def format_output(
if self.use_default_structured_output:
return self._format_structured_output(output)

match = POSITIVE_NEGATIVE_PAIR_REGEX.match(output)
match = POSITIVE_NEGATIVE_PAIR_REGEX.search(output)
if match is None:
formatted_output = {"positive": None}
if self.triplet:
Expand Down

0 comments on commit e866345

Please sign in to comment.