[Bugfix] Migrate to REGEX Library to prevent catastrophic backtracking (#18454)

Signed-off-by: Crucifixion-Fxl <xmufxl@gmail.com>
Co-authored-by: Crucifixion-Fxl <xmufxl@gmail.com>
This commit is contained in:
Feng XiaoLong
2025-05-23 16:16:26 -07:00
committed by GitHub
co-authored by Crucifixion-Fxl
parent f2036734fb
commit 4fc1bf813a
52 changed files with 62 additions and 58 deletions
+1 -1
View File
@@ -14,11 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Wrapper around `transformers` models"""
import re
from collections.abc import Iterable
from contextlib import nullcontext
from typing import Literal, Optional, Union
import regex as re
import torch
from torch import nn
from transformers import AutoModel, PretrainedConfig, PreTrainedModel