Skip to content

Commit

Permalink
bugfix for inference prompt template
Browse files Browse the repository at this point in the history
Signed-off-by: HuiyingLi <[email protected]>
  • Loading branch information
HuiyingLi committed Feb 16, 2024
1 parent 9b615b8 commit 99993d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nemo/collections/multimodal/data/neva/neva_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ def preprocess_nv_dpo(sources: dict, tokenizer, cfg,) -> Dict:
conv.append_message(turn['from'], turn['value'])
context = conv.get_prompt()
if strip_end_for_inference:
context = context.rstrip("\n<extra_id_1>") + "\n"
if context.endswith("\n<extra_id_1>"):
context = context[:-len("\n<extra_id_1>")] + "\n"
conversations.append(context)

add_extra_token = cfg.get("add_extra_token")
Expand Down

0 comments on commit 99993d2

Please sign in to comment.