You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GenerateSentencePair Task always (or very often) returns None positives. I have already investigated the issue, and found out that the regex uses .match(...) rather than .search(...) to find the pattern in the output:
As a context, re.match(...) tries to match the pattern only at the beginning of a string, while re.search(...) searches the first occurrence in the whole output (see search() vs. match() in the Python docs). In my case, for some reason the output using meta-llama/Llama-3.1-8B-Instruct was always something like:
---
Anchor: The rising cost of living in big cities is pushing more and more people towards the suburbs.
## Positive
The increasing availability of job opportunities and affordable housing in the suburbs is attracting many young professionals away from the high-stress, expensive urban lifestyle.
which is never matched using .match(...), while .search(...) does the job.
The GenerateSentencePair Task always (or very often) returns None positives. I have already investigated the issue, and found out that the regex uses
.match(...)
rather than.search(...)
to find the pattern in the output:distilabel/src/distilabel/steps/tasks/sentence_transformers.py
Line 349 in 844165f
As a context,
re.match(...)
tries to match the pattern only at the beginning of a string, whilere.search(...)
searches the first occurrence in the whole output (see search() vs. match() in the Python docs). In my case, for some reason the output usingmeta-llama/Llama-3.1-8B-Instruct
was always something like:which is never matched using
.match(...)
, while.search(...)
does the job.I'm not sure if this was expected or considered a feature, but I noticed that the same behavior might occur somewhere else in the code, as I have found multiple occurrences simply searching this: https://github.com/search?q=repo%3Aargilla-io%2Fdistilabel%20.match(&type=code
The text was updated successfully, but these errors were encountered: