Formatter LM
Collection
Some experiments with chat templates and tokenizers
•
6 items
•
Updated
This is mainly my experiment to play around with adding special tokens and changing the chat template while fine-tuning.
{%- for message in messages %}
{%- if message.role == "user" %}
{{- '<|problem_start|>
' + message.content + '<|problem_end|>
' }}
{%- elif message.role == "assistant" %}
{{- '<|formatted_problem_start|>
' + message.content + '<|formatted_problem_end|>
' }}
{%- else %}
{# Raise an error for unsupported roles, as per requirement to remove system message stuff #}
{{- raise('Unknown role: ' + message.role) }}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|formatted_problem_start|>
' }}
{%- endif %}
Example:
User: Read the excerpt from Dr. Martin Luther King Jr.’s "I Have a Dream" speech.
I am not unmindful that some of you have come here out of great trials and tribulations. Some of you have come fresh from narrow jail cells. Some of you have come from areas where your quest for freedom left you battered by the storms of persecution and staggered by the winds of police brutality. You have been the veterans of creative suffering. Continue to work with the faith that unearned suffering is redemptive. Go back to Mississippi, go back to Alabama, go back to South Carolina, go back to Georgia, go back to Louisiana, go back to the slums and ghettos of our northern cities, knowing that somehow this situation can and will be changed. Let us not wallow in the valley of despair.
Which lines in this paragraph can be used as examples of metaphor? Select 3 options.
great trials and tribulations
storms of persecution
winds of police brutality
go back to Georgia
this situation can and will be changed
let us not wallow in the valley of despair
LLM: Read the excerpt from Dr. Martin Luther King Jr.’s "I Have a Dream" speech.
I am not unmindful that some of you have come here out of great trials and tribulations. Some of you have come fresh from narrow jail cells. Some of you have come from areas where your quest for freedom left you battered by the storms of persecution and staggered by the winds of police brutality. You have been the veterans of creative suffering. Continue to work with the faith that unearned suffering is redemptive. Go back to Mississippi, go back to Alabama, go back to South Carolina, go back to Georgia, go back to Louisiana, go back to the slums and ghettos of our northern cities, knowing that somehow this situation can and will be changed. Let us not wallow in the valley of despair.
Which lines in this paragraph can be used as examples of metaphor? Select 3 options.
A. great trials and tribulations
B. storms of persecution
C. winds of police brutality
D. go back to Georgia
E. this situation can and will be changed
F. let us not wallow in the valley of despair
<|endoftext|>
as the EOS token. Then you can train it to use other tokens like <|im_end|>
. If you set the EOS token to <|im_end|>
, the model will get confused.<|endoftext|>
at the end of each training example.