singleheart togetherhaiku commited on
Commit
3d41848
·
verified ·
1 Parent(s): d6fac98

add message.content check to prevent UndefinedError (#4)

Browse files

- add message.content check to prevent UndefinedError (dda4e09a838e4e51365381ddccadd38c99b86afc)


Co-authored-by: Harish K <togetherhaiku@users.noreply.huggingface.co>

Files changed (1) hide show
  1. chat_template.jinja +1 -1
chat_template.jinja CHANGED
@@ -42,7 +42,7 @@
42
  {%- endif %}
43
 
44
  {%- if add_generation_prompt and not (message.reasoning_content is defined and message.reasoning_content is not none) %}
45
- {%- if '</think>' in message.content %}
46
  {%- set content = message.content.split('</think>'.strip())[-1].lstrip('\n') %}
47
  {%- endif %}
48
  {%- endif %}
 
42
  {%- endif %}
43
 
44
  {%- if add_generation_prompt and not (message.reasoning_content is defined and message.reasoning_content is not none) %}
45
+ {%- if message.content is defined and '</think>' in message.content %}
46
  {%- set content = message.content.split('</think>'.strip())[-1].lstrip('\n') %}
47
  {%- endif %}
48
  {%- endif %}