diff --git a/modules/models_settings.py b/modules/models_settings.py index aa16fdb9..7645880f 100644 --- a/modules/models_settings.py +++ b/modules/models_settings.py @@ -94,8 +94,6 @@ def get_model_metadata(model): template = re.sub(r"\{\{-?\s*raise_exception\(.*?\)\s*-?\}\}", "", template, flags=re.DOTALL) template = re.sub(r'raise_exception\([^)]*\)', "''", template) - template = re.sub(r'{% if add_generation_prompt %}.*', '', template, flags=re.DOTALL) - template = re.sub(r'elif loop\.last and not add_generation_prompt', 'elif False', template) # Handle GPT-OSS model_settings['instruction_template'] = 'Custom (obtained from model metadata)' model_settings['instruction_template_str'] = template @@ -172,8 +170,6 @@ def get_model_metadata(model): template = re.sub(r"\{\{-?\s*raise_exception\(.*?\)\s*-?\}\}", "", template, flags=re.DOTALL) template = re.sub(r'raise_exception\([^)]*\)', "''", template) - template = re.sub(r'{% if add_generation_prompt %}.*', '', template, flags=re.DOTALL) - template = re.sub(r'elif loop\.last and not add_generation_prompt', 'elif False', template) # Handle GPT-OSS model_settings['instruction_template'] = 'Custom (obtained from model metadata)' model_settings['instruction_template_str'] = template