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
Add an optional argument to the regex generator representing a conditional stopping condition. This stopping condition is a regular expression. The generation terminates whenever the output matches the condition.
For example, when using this regex "A:[\s\S]{50,700}The answer is [1-9][0-9]{0,9}\." for structured generation (see this blogpost), the output might contain several sentences of the form "The answer is". It may be useful to stop generation whenever the LLM produces an output containing one instance of "The answer is [1-9][0-9]{0,9}\.".
Where does it fit in Outlines?
Adding an optional argument stopping_regex (of type str) to the regex generator.
Are you willing to open a PR?
I haven't looked at all the details, but yes.
The text was updated successfully, but these errors were encountered:
This feature was recently discussed with @alonsosilvaallende and @rlouf.
Presentation of the new feature
Add an optional argument to the regex generator representing a conditional stopping condition. This stopping condition is a regular expression. The generation terminates whenever the output matches the condition.
For example, when using this regex
"A:[\s\S]{50,700}The answer is [1-9][0-9]{0,9}\."
for structured generation (see this blogpost), the output might contain several sentences of the form "The answer is". It may be useful to stop generation whenever the LLM produces an output containing one instance of"The answer is [1-9][0-9]{0,9}\."
.Where does it fit in Outlines?
Adding an optional argument
stopping_regex
(of typestr
) to the regex generator.Are you willing to open a PR?
I haven't looked at all the details, but yes.
The text was updated successfully, but these errors were encountered: