Update tokenizer_utils.py
This commit is contained in:
parent
6ae8ef7fdf
commit
55967af47d
1 changed files with 2 additions and 1 deletions
|
|
@ -952,8 +952,9 @@ def patch_sft_trainer_tokenizer():
|
|||
check_text = "\n".join(" "*where + x for x in check_text)
|
||||
|
||||
if replacer is None:
|
||||
# .*? matches first match. .+? matches final match.
|
||||
replacer = re.findall(
|
||||
f"def {function_name}\(.+?\).+?\:\n",
|
||||
f"def {function_name}\(.*?\).*?\:\n",
|
||||
function,
|
||||
flags = re.MULTILINE | re.DOTALL,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue