Fix TRL 1.8.2 (#2774)
* Fix for TRL 1.8.2 Regex matching LLM initialization * Update Regex
This commit is contained in:
parent
1c7a9f46dc
commit
35d37ea567
1 changed files with 1 additions and 1 deletions
|
|
@ -746,7 +746,7 @@ def patch_functions(RLTrainer, trainer_file, RLTrainer_name, all_imports, import
|
|||
|
||||
if trl_version >= "0.18":
|
||||
# Replace LLM init with already existing vLLM engine for colocate mode
|
||||
vllm_llm_init_pattern = r"self\.llm\s*=\s*LLM\([^)]*\)*\)"
|
||||
vllm_llm_init_pattern = r"self\.llm\s*=\s*LLM\(.*?\)*\)\s*?\n(?!,)"
|
||||
vllm_llm_replacement = "self.llm = model.vllm_engine\n"
|
||||
new_vllm_part = re.sub(
|
||||
vllm_llm_init_pattern,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue