Skip to content

Commit

Permalink
add nv_dpo conversation to accomendate empty system message
Browse files Browse the repository at this point in the history
Signed-off-by: HuiyingLi <[email protected]>
  • Loading branch information
HuiyingLi committed Feb 8, 2024
1 parent 80f8465 commit b0f966d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions nemo/collections/multimodal/data/neva/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,17 @@ def dict(self):
sep2=f"{DEFAULT_SYSTEM_TOKEN}System\n",
)

conv_nv_dpo = Conversation(
system="\n",
roles=("User", "Assistant"),
version="nv_dpo",
messages=(),
offset=0,
sep_style=SeparatorStyle.NVGPT,
sep=DEFAULT_SEPARATOR_TOKEN,
sep2=f"{DEFAULT_SYSTEM_TOKEN}System\n",
)

conv_vicuna_v0 = Conversation(
system="A chat between a curious human and an artificial intelligence assistant. "
"The assistant gives helpful, detailed, and polite answers to the human's questions.",
Expand Down Expand Up @@ -400,8 +411,8 @@ def dict(self):
"v1_mmtag": conv_llava_v1_mmtag,
"llava_llama_2": conv_llava_llama_2,
"nvgpt": conv_nvgpt,
"nv_dpo": conv_nvgpt,
"nv_steerlm": conv_nvgpt
"nv_steerlm": conv_nvgpt,
"nv_dpo": conv_nv_dpo,
}


Expand Down
2 changes: 1 addition & 1 deletion nemo/collections/multimodal/data/neva/neva_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def preprocess_nv_dpo(sources: dict, tokenizer, cfg,) -> Dict:
"""<extra_id_0>System\n\n<extra_id_1>User\n{user input}\n<extra_id_1>Assistant\n"""


conv = conversation_lib.conv_nvgpt.copy()
conv = conversation_lib.conv_nv_dpo.copy()

# Apply prompt templates
conversations = []
Expand Down

0 comments on commit b0f966d

Please sign in to comment.