Skip to content

Commit

Permalink
fix CLEAN RESPONSE logic to not use last EOS
Browse files Browse the repository at this point in the history
Signed-off-by: HuiyingLi <[email protected]>
  • Loading branch information
HuiyingLi committed May 13, 2024
1 parent 14d4327 commit b605b6e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def megatron_neva_generate(model, prompt_dict_list, length_params, sampling_para
clean_response = clean_response[last_match_end_position:]
clean_response = clean_response.strip("<extra_id_1>")
elif conv_template == 'nv_dpo':
clean_response = clean_response.split("<extra_id_1>")[-2][10:] # [10:] for removing "Assistant\n"
clean_response = clean_response.split("<extra_id_1>Assistant\n")[1]
elif conv_template == "llama_2":
clean_response = clean_response.rsplit("[/INST] ", 1)[-1]
elif conv_template == "v1":
Expand Down

0 comments on commit b605b6e

Please sign in to comment.