NanoSocrates/Project_Model/Libs/BPE/Utils/special_regex_maker.py

10 lines
155 B
Python
Raw Normal View History

import re
def special_regex_maker(special_tokens: list[str]) -> re.Pattern:
REGEX_STR = "|".join(special_tokens)
return re.compile(REGEX_STR)