More syntax warnings (#1944)
* move use_modelscope to _utils * fix * Update _utils.py * Update loader.py --------- Co-authored-by: Daniel Han <danielhanchen@gmail.com>
This commit is contained in:
parent
544b76b7e1
commit
4857e5851d
2 changed files with 2 additions and 2 deletions
|
|
@ -536,7 +536,7 @@ def patch_functions(RLTrainer, trainer_file, RLTrainer_name, all_imports, import
|
|||
if "args.use_vllm" in init and "model" in init and "args" in init:
|
||||
# .*? matches first match. .+? matches final match.
|
||||
replacer = re.findall(
|
||||
"def __init__\(.*?\).*?\:\n",
|
||||
r"def __init__\(.*?\).*?\:\n",
|
||||
init,
|
||||
flags = re.MULTILINE | re.DOTALL,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -945,7 +945,7 @@ def patch_sft_trainer_tokenizer():
|
|||
if replacer is None:
|
||||
# .*? matches first match. .+? matches final match.
|
||||
replacer = re.findall(
|
||||
f"def {function_name}\(.*?\).*?\:\n",
|
||||
f"def {function_name}" + r"\(.*?\).*?\:\n",
|
||||
function,
|
||||
flags = re.MULTILINE | re.DOTALL,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue