diff --git a/outlines/text/generate/regex.py b/outlines/text/generate/regex.py index 76a0a4c38..15e28152d 100644 --- a/outlines/text/generate/regex.py +++ b/outlines/text/generate/regex.py @@ -146,6 +146,10 @@ def create_proposal( return logits + mask + def postprocess_completions(self, completions: List[str]) -> List[str]: + self.pstates.clear() + return super().postprocess_completions(completions) + def regex(model, regex_string: str, max_tokens: Optional[int] = None): """Generate text sequences that match the input regex.