Skip to content

Commit

Permalink
Update formats (#769)
Browse files Browse the repository at this point in the history
updated formats

Co-authored-by: michal <shmueli@il.ibm.com>
Co-authored-by: Yoav Katz <68273864+yoavkatz@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 17, 2024
1 parent 2661e2c commit 299bc96
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions prepare/formats/empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from unitxt.formats import SystemFormat

format = SystemFormat(
demo_format="{source}\n {target_prefix}{target}\n\n",
model_input_format="{system_prompt}{instruction}{demos}{source}\n{target_prefix}",
demo_format="{source}\\N{target_prefix}{target}\n\n",
model_input_format="{system_prompt}\\N{instruction}\\N{demos}{source}\\N{target_prefix}",
)

add_to_catalog(format, "formats.empty", overwrite=True)
2 changes: 1 addition & 1 deletion prepare/formats/models/llama2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# {{ user_msg_1 }} [/INST] {{ model_answer_1 }} </s><s>[INST] {{ user_msg_2 }} [/INST]
format = SystemFormat(
demo_format="{source} [/INST] {target_prefix}{target} </s><s>[INST] ",
model_input_format="[INST] <<SYS>>\n{system_prompt}\n\n{instruction}<<SYS>>\n\n\n{demos}{source} [/INST]{target_prefix}",
model_input_format="[INST] <<SYS>>\n{system_prompt}\\N{instruction}<</SYS>>\n\n\n{demos}{source} [/INST] {target_prefix}",
)

add_to_catalog(format, "formats.llama2", overwrite=True)
4 changes: 2 additions & 2 deletions src/unitxt/catalog/formats/empty.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "system_format",
"demo_format": "{source}\n {target_prefix}{target}\n\n",
"model_input_format": "{system_prompt}{instruction}{demos}{source}\n{target_prefix}"
"demo_format": "{source}\\N{target_prefix}{target}\n\n",
"model_input_format": "{system_prompt}\\N{instruction}\\N{demos}{source}\\N{target_prefix}"
}
2 changes: 1 addition & 1 deletion src/unitxt/catalog/formats/llama2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "system_format",
"demo_format": "{source} [/INST] {target_prefix}{target} </s><s>[INST] ",
"model_input_format": "[INST] <<SYS>>\n{system_prompt}\n\n{instruction}<<SYS>>\n\n\n{demos}{source} [/INST]{target_prefix}"
"model_input_format": "[INST] <<SYS>>\n{system_prompt}\\N{instruction}<</SYS>>\n\n\n{demos}{source} [/INST] {target_prefix}"
}

0 comments on commit 299bc96

Please sign in to comment.