Advertisement
Guest User

Test command-r instruction template

a guest
Mar 27th, 2024
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | Software | 0 0
  1. {{-'<|BOS_TOKEN|>'-}}
  2. {%- set ns = namespace(found=false) -%}
  3. {%- for message in messages -%}
  4. {%- if message['role'] == 'system' -%}
  5. {%- set ns.found = true -%}
  6. {%- endif -%}
  7. {%- endfor -%}
  8. {%- for message in messages %}
  9. {%- if message['role'] == 'system' -%}
  10. {{- '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|> ' + message['content'].rstrip() + '<|END_OF_TURN_TOKEN|>' -}}
  11. {%- else -%}
  12. {%- if message['role'] == 'user' -%}
  13. {{-'<|START_OF_TURN_TOKEN|><|USER_TOKEN|> ' + message['content'].rstrip() + '<|END_OF_TURN_TOKEN|>'-}}
  14. {%- else -%}
  15. {{-'<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> ' + message['content'] + '<|END_OF_TURN_TOKEN|>' -}}
  16. {%- endif -%}
  17. {%- endif -%}
  18. {%- endfor -%}
  19. {%- if add_generation_prompt -%}
  20. {{-'<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> '-}}
  21. {%- endif -%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement