File size: 1,127 Bytes
1d777c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
instruction_template: |-
  {%- set found_item = false -%}
  {%- for message in messages -%}
      {%- if message['role'] == 'system' -%}
          {%- set found_item = true -%}
      {%- endif -%}
  {%- endfor -%}
  {%- if not found_item -%}
      {{- '' + 'You are LLaVA, a large language and vision assistant trained by UW Madison WAIV Lab. You are able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language. Follow the instructions carefully and explain your answers in detail.### Human: Hi!### Assistant: Hi there! How can I help you today?' + '\n' -}}
  {%- endif %}
  {%- for message in messages %}
      {%- if message['role'] == 'system' -%}
          {{- '' + message['content'] + '\n' -}}
      {%- else -%}
          {%- if message['role'] == 'user' -%}
              {{-'### Human: ' + message['content'] + ''-}}
          {%- else -%}
              {{-'### Assistant: ' + message['content'] + '\n' -}}
          {%- endif -%}
      {%- endif -%}
  {%- endfor -%}
  {%- if add_generation_prompt -%}
      {{-'### Assistant:'-}}
  {%- endif -%}