Skip to content

Commit 299bc96

Browse files
elronbandelgitMichalyoavkatz
authored
Update formats (#769)
updated formats Co-authored-by: michal <[email protected]> Co-authored-by: Yoav Katz <[email protected]>
1 parent 2661e2c commit 299bc96

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

prepare/formats/empty.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from unitxt.formats import SystemFormat
33

44
format = SystemFormat(
5-
demo_format="{source}\n {target_prefix}{target}\n\n",
6-
model_input_format="{system_prompt}{instruction}{demos}{source}\n{target_prefix}",
5+
demo_format="{source}\\N{target_prefix}{target}\n\n",
6+
model_input_format="{system_prompt}\\N{instruction}\\N{demos}{source}\\N{target_prefix}",
77
)
88

99
add_to_catalog(format, "formats.empty", overwrite=True)

prepare/formats/models/llama2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# {{ user_msg_1 }} [/INST] {{ model_answer_1 }} </s><s>[INST] {{ user_msg_2 }} [/INST]
1010
format = SystemFormat(
1111
demo_format="{source} [/INST] {target_prefix}{target} </s><s>[INST] ",
12-
model_input_format="[INST] <<SYS>>\n{system_prompt}\n\n{instruction}<<SYS>>\n\n\n{demos}{source} [/INST]{target_prefix}",
12+
model_input_format="[INST] <<SYS>>\n{system_prompt}\\N{instruction}<</SYS>>\n\n\n{demos}{source} [/INST] {target_prefix}",
1313
)
1414

1515
add_to_catalog(format, "formats.llama2", overwrite=True)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"type": "system_format",
3-
"demo_format": "{source}\n {target_prefix}{target}\n\n",
4-
"model_input_format": "{system_prompt}{instruction}{demos}{source}\n{target_prefix}"
3+
"demo_format": "{source}\\N{target_prefix}{target}\n\n",
4+
"model_input_format": "{system_prompt}\\N{instruction}\\N{demos}{source}\\N{target_prefix}"
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"type": "system_format",
33
"demo_format": "{source} [/INST] {target_prefix}{target} </s><s>[INST] ",
4-
"model_input_format": "[INST] <<SYS>>\n{system_prompt}\n\n{instruction}<<SYS>>\n\n\n{demos}{source} [/INST]{target_prefix}"
4+
"model_input_format": "[INST] <<SYS>>\n{system_prompt}\\N{instruction}<</SYS>>\n\n\n{demos}{source} [/INST] {target_prefix}"
55
}

0 commit comments

Comments
 (0)