mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-12-06 07:12:10 +01:00
Remove changes to the jinja2 templates
This commit is contained in:
parent
aad0104c1b
commit
adeca8a658
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue