community[minor]: Fix regular expression in visualize and outlines modules. (#30002)

Fix invalid escape characteres
This commit is contained in:
Philippe PRADOS 2025-03-04 18:23:48 +01:00 committed by GitHub
parent 577c0d0715
commit 4710c1fa8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ _EDGE_DIRECTION = {
"bidir": "both",
}
_WORD_RE = re.compile("\s*\S+")
_WORD_RE = re.compile(r"\s*\S+")
def _split_prefix(s: str, max_chars: int = 50) -> str:

View File

@ -59,7 +59,7 @@ class Outlines(LLM):
"""Whether to stream the results, token by token."""
regex: Optional[str] = None
"""Regular expression for structured generation.
r"""Regular expression for structured generation.
If provided, Outlines will guarantee that the generated text matches this regex.
This can be useful for generating structured outputs like IP addresses, dates, etc.