Skip to content

Commit

Permalink
sys prompt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rajammanabrolu committed Jan 22, 2024
1 parent b2a0c03 commit 5971009
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion llmfoundry/tokenizers/tiktoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def default_chat_template(self):
'{% for message in loop_messages %}'
'{% if loop.index0 == 0 %}'
'{% if system_message != false %}'
"{{ '<|im_start|>system\n' + system_message.strip() + '\n'}}"
"{{ '<|im_start|>system\n' + system_message.strip() + '<|im_end|>\n'}}"
'{% endif %}'
"{{ '<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' }}"
'{% else %}'
Expand Down
10 changes: 5 additions & 5 deletions tests/tokenizers/test_tiktoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
('gpt2', None),
]

DEFAULT_SYSTEM_PROMPT = """<|im_start|>system\nYou are a helpful, respectful and honest assistant. Always answer as helpfully as possible."""
DEFAULT_SYSTEM_PROMPT = """<|im_start|>system\nYou are a helpful, respectful and honest assistant. Always answer as helpfully as possible.<|im_end|>"""

MULTI_TURN_CHAT_ML = [
[{
Expand Down Expand Up @@ -75,7 +75,7 @@
<|im_start|>assistant
You should go outside and touch grass.<|im_end|><|endoftext|>""",
"""<|im_start|>system
You are a honest and helpful AI language model. Tell the user the truth, the whole truth, and nothing but the truth.
You are a honest and helpful AI language model. Tell the user the truth, the whole truth, and nothing but the truth.<|im_end|>
<|im_start|>user
Please summarize the goals in this text:
Expand All @@ -86,15 +86,15 @@

MULTI_TURN_CHAT_STRING_SYSTEM_PROMPT = [
"""<|im_start|>system
You are a helpful, respectful and honest assistant. Always answer as helpfully as possible.
You are a helpful, respectful and honest assistant. Always answer as helpfully as possible.<|im_end|>
<|im_start|>user
Please summarize the goals in this text:
Going outside has benefits include reducing stress and triggering the relaxation response, which can help us not only feel better mentally, but even heal faster from physical ailments.<|im_end|>
<|im_start|>assistant
You should go outside and touch grass.<|im_end|><|endoftext|>""",
"""<|im_start|>system
You are a honest and helpful AI language model. Tell the user the truth, the whole truth, and nothing but the truth.
You are a honest and helpful AI language model. Tell the user the truth, the whole truth, and nothing but the truth.<|im_end|>
<|im_start|>user
Please summarize the goals in this text:
Expand All @@ -118,7 +118,7 @@

MULTI_TURN_GENERATE_STRING = [
"""<|im_start|>system
You are a helpful, respectful and honest assistant. Always answer as helpfully as possible.
You are a helpful, respectful and honest assistant. Always answer as helpfully as possible.<|im_end|>
<|im_start|>user
Please summarize the goals in this text:
Expand Down

0 comments on commit 5971009

Please sign in to comment.