Added utils to make regexps and iterators that check for last element
This commit is contained in:
9
Project_Model/Libs/BPE/Utils/special_regex_maker.py
Normal file
9
Project_Model/Libs/BPE/Utils/special_regex_maker.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import re
|
||||
|
||||
|
||||
def special_regex_maker(special_tokens: list[str]) -> re.Pattern:
|
||||
|
||||
REGEX_STR = "|".join(special_tokens)
|
||||
|
||||
return re.compile(REGEX_STR)
|
||||
|
||||
Reference in New Issue
Block a user