A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 08:30 UTC
[CI/Build] Remove imports of built-in `re` (#18750)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
May 27, 2025 at 17:19 UTC
4318c0559d9edab7c644d6a1968fdc008bc75104
8 files changed
+10
-9
.pre-commit-config.yaml
+1
@@ -142,6 +142,7 @@ repos:
142
language: python
143
types: [python]
144
pass_filenames: false
145
+ additional_dependencies: [regex]
146
# Keep `suggestion` last
147
- id: suggestion
148
name: Suggestion
docs/mkdocs/hooks/generate_examples.py
+2
-2
@@ -1,11 +1,11 @@
1
# SPDX-License-Identifier: Apache-2.0
2
-
2
import itertools
4
-import re
3
from dataclasses import dataclass, field
4
from pathlib import Path
5
from typing import Literal
6
7
+import regex as re
8
+
9
ROOT_DIR = Path(__file__).parent.parent.parent.parent
10
ROOT_DIR_RELATIVE = '../../../../..'
11
EXAMPLE_DIR = ROOT_DIR / "examples"
docs/mkdocs/hooks/url_schemes.py
+1
-2
@@ -1,6 +1,5 @@
1
# SPDX-License-Identifier: Apache-2.0
2
-import re
3
-
2
+import regex as re
3
from mkdocs.config.defaults import MkDocsConfig
4
from mkdocs.structure.files import Files
5
from mkdocs.structure.pages import Page
requirements/docs.txt
+1
@@ -5,4 +5,5 @@ mkdocstrings-python
5
mkdocs-gen-files
6
mkdocs-awesome-nav
7
python-markdown-math
8
+regex
9
ruff
tools/check_triton_import.py
+2
-1
@@ -1,8 +1,9 @@
1
# SPDX-License-Identifier: Apache-2.0
2
-import re
2
import subprocess
3
import sys
4
5
+import regex as re
6
+
7
FORBIDDEN_IMPORT_RE = re.compile(r"^(from|import)\s+triton(\s|\.|$)")
8
9
# the way allowed to import triton
vllm/entrypoints/openai/tool_parsers/llama4_pythonic_tool_parser.py
+1
-2
@@ -1,11 +1,10 @@
1
# SPDX-License-Identifier: Apache-2.0
2
-
2
import ast
3
import json
5
-import re
4
from collections.abc import Sequence
5
from typing import Any, Union
6
7
+import regex as re
8
from transformers import PreTrainedTokenizerBase
9
10
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,
vllm/model_executor/guided_decoding/guidance_decoding.py
+1
-1
@@ -1,8 +1,8 @@
1
# SPDX-License-Identifier: Apache-2.0
2
import json
3
-from re import escape as regex_escape
3
4
import llguidance
5
+from regex import escape as regex_escape
6
from transformers import PreTrainedTokenizerBase
7
8
from vllm.model_executor.guided_decoding.guidance_logits_processors import (
vllm/model_executor/guided_decoding/outlines_decoding.py
+1
-1
@@ -5,9 +5,9 @@ import concurrent.futures
5
import os
6
from enum import Enum
7
from json import dumps as json_dumps
8
-from re import escape as regex_escape
8
from typing import Optional, Union
9
10
+from regex import escape as regex_escape
11
from transformers import PreTrainedTokenizerBase
12
13
from vllm.model_executor.guided_decoding.outlines_logits_processors import (