Only use enable_thinking if the template supports it

This commit is contained in:
oobabooga 2025-08-05 17:33:27 -07:00
parent bfbbfc2361
commit fbea21a1f1

View file

@ -307,7 +307,7 @@ def generate_chat_prompt(user_input, state, **kwargs):
prompt += prefix
if state['mode'] == 'instruct' and not any((_continue, impersonate, state['enable_thinking'])):
if state['mode'] == 'instruct' and 'enable_thinking' in state['instruction_template_str'] and not any((_continue, impersonate, state['enable_thinking'])):
prompt += get_thinking_suppression_string(instruction_template)
return prompt