Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {{-'<|BOS_TOKEN|>'-}}
- {%- set ns = namespace(found=false) -%}
- {%- for message in messages -%}
- {%- if message['role'] == 'system' -%}
- {%- set ns.found = true -%}
- {%- endif -%}
- {%- endfor -%}
- {%- for message in messages %}
- {%- if message['role'] == 'system' -%}
- {{- '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|> ' + message['content'].rstrip() + '<|END_OF_TURN_TOKEN|>' -}}
- {%- else -%}
- {%- if message['role'] == 'user' -%}
- {{-'<|START_OF_TURN_TOKEN|><|USER_TOKEN|> ' + message['content'].rstrip() + '<|END_OF_TURN_TOKEN|>'-}}
- {%- else -%}
- {{-'<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> ' + message['content'] + '<|END_OF_TURN_TOKEN|>' -}}
- {%- endif -%}
- {%- endif -%}
- {%- endfor -%}
- {%- if add_generation_prompt -%}
- {{-'<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> '-}}
- {%- endif -%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement