Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ChatML template #5411

Merged
merged 29 commits into from
Feb 5, 2024
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c3e0fcf
Merge pull request #4927 from oobabooga/dev
oobabooga Dec 15, 2023
443be39
Merge pull request #4937 from oobabooga/dev
oobabooga Dec 15, 2023
7be0983
Merge pull request #4961 from oobabooga/dev
oobabooga Dec 17, 2023
b28020a
Merge pull request #4980 from oobabooga/dev
oobabooga Dec 18, 2023
781367b
Merge pull request #4988 from oobabooga/dev
oobabooga Dec 19, 2023
71eb744
Merge pull request #5002 from oobabooga/dev
oobabooga Dec 19, 2023
5b791ca
Merge pull request #5005 from oobabooga/dev
oobabooga Dec 19, 2023
c1f78db
Merge pull request #5011 from oobabooga/dev
oobabooga Dec 20, 2023
489f4a2
Merge pull request #5012 from oobabooga/dev
oobabooga Dec 20, 2023
11288d1
Merge pull request #5022 from oobabooga/dev
oobabooga Dec 20, 2023
4b25acf
Merge pull request #5039 from oobabooga/dev
oobabooga Dec 21, 2023
af87609
Merge pull request #5073 from oobabooga/dev
oobabooga Dec 25, 2023
19d1374
Merge pull request #5078 from oobabooga/dev
oobabooga Dec 25, 2023
3fd7073
Merge pull request #5100 from oobabooga/dev
oobabooga Dec 27, 2023
3e3a66e
Merge pull request #5132 from oobabooga/dev
oobabooga Dec 31, 2023
3f28925
Merge pull request #5152 from oobabooga/dev
oobabooga Jan 2, 2024
c54d1da
Merge pull request #5163 from oobabooga/dev
oobabooga Jan 4, 2024
8ea3f31
Merge pull request #5181 from oobabooga/dev
oobabooga Jan 5, 2024
e169993
Merge pull request #5195 from oobabooga/dev
oobabooga Jan 7, 2024
ad1ff53
Merge pull request #5199 from oobabooga/dev
oobabooga Jan 7, 2024
2dc8db8
Merge pull request #5220 from oobabooga/dev
oobabooga Jan 10, 2024
61e4bfe
Merge pull request #5253 from oobabooga/dev
oobabooga Jan 14, 2024
d8c3a5b
Merge pull request #5266 from oobabooga/dev
oobabooga Jan 14, 2024
1343aa3
Merge pull request #5347 from oobabooga/dev
oobabooga Jan 22, 2024
837bd88
Merge pull request #5348 from oobabooga/dev
oobabooga Jan 22, 2024
e7a760e
Merge pull request #5379 from oobabooga/dev
oobabooga Jan 26, 2024
4f3fdf1
Merge pull request #5404 from oobabooga/dev
oobabooga Jan 30, 2024
3ce661f
Improve ChatML template
BadisG Jan 31, 2024
757aa4c
Minor change
oobabooga Feb 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions instruction-templates/ChatML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ instruction_template: |-
{%- set ns.found = true -%}
{%- endif -%}
{%- endfor -%}
{%- if not ns.found -%}
{{- '<|im_start|>system\n' + '' + '<|im_end|>\n' -}}
{%- endif %}
{%- for message in messages %}
{%- if message['role'] == 'system' -%}
{{- '<|im_start|>system\n' + message['content'] + '<|im_end|>\n' -}}
{{- '<|im_start|>system\n' + message['content'].rstrip() + '<|im_end|>\n' -}}
{%- else -%}
{%- if message['role'] == 'user' -%}
{{-'<|im_start|>user\n' + message['content'] + '<|im_end|>\n'-}}
{{-'<|im_start|>user\n' + message['content'].rstrip() + '<|im_end|>\n'-}}
{%- else -%}
{{-'<|im_start|>assistant\n' + message['content'] + '<|im_end|>\n' -}}
{%- endif -%}
Expand Down