From 40a2441deb4df340101b713e89e6b4f65cc1e488 Mon Sep 17 00:00:00 2001 From: RangiLyu Date: Fri, 19 Jan 2024 18:21:47 +0800 Subject: [PATCH] Update hf_internlm2_chat template (#823) * Update hf_internlm2_chat template * Update 20B --- configs/models/hf_internlm/hf_internlm2_chat_20b.py | 8 ++++---- configs/models/hf_internlm/hf_internlm2_chat_7b.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configs/models/hf_internlm/hf_internlm2_chat_20b.py b/configs/models/hf_internlm/hf_internlm2_chat_20b.py index ea82b80e9..02d2d6831 100644 --- a/configs/models/hf_internlm/hf_internlm2_chat_20b.py +++ b/configs/models/hf_internlm/hf_internlm2_chat_20b.py @@ -3,9 +3,9 @@ _meta_template = dict( round=[ - dict(role='HUMAN', begin='[UNUSED_TOKEN_146]user\n', end='[UNUSED_TOKEN_145]\n'), - dict(role='SYSTEM', begin='[UNUSED_TOKEN_146]system\n', end='[UNUSED_TOKEN_145]\n'), - dict(role='BOT', begin='[UNUSED_TOKEN_146]assistant\n', end='[UNUSED_TOKEN_145]\n', generate=True), + dict(role='HUMAN', begin='<|im_start|>user\n', end='<|im_end|>\n'), + dict(role='SYSTEM', begin='<|im_start|>system\n', end='<|im_end|>\n'), + dict(role='BOT', begin='<|im_start|>assistant\n', end='<|im_end|>\n', generate=True), ], eos_token_id=92542 ) @@ -31,6 +31,6 @@ batch_size=8, meta_template=_meta_template, run_cfg=dict(num_gpus=2, num_procs=1), - end_str='[UNUSED_TOKEN_145]', + end_str='<|im_end|>', ) ] diff --git a/configs/models/hf_internlm/hf_internlm2_chat_7b.py b/configs/models/hf_internlm/hf_internlm2_chat_7b.py index f2efbbbe0..ba67d6da2 100644 --- a/configs/models/hf_internlm/hf_internlm2_chat_7b.py +++ b/configs/models/hf_internlm/hf_internlm2_chat_7b.py @@ -3,9 +3,9 @@ _meta_template = dict( round=[ - dict(role='HUMAN', begin='[UNUSED_TOKEN_146]user\n', end='[UNUSED_TOKEN_145]\n'), - dict(role='SYSTEM', begin='[UNUSED_TOKEN_146]system\n', end='[UNUSED_TOKEN_145]\n'), - dict(role='BOT', begin='[UNUSED_TOKEN_146]assistant\n', end='[UNUSED_TOKEN_145]\n', generate=True), + dict(role='HUMAN', begin='<|im_start|>user\n', end='<|im_end|>\n'), + dict(role='SYSTEM', begin='<|im_start|>system\n', end='<|im_end|>\n'), + dict(role='BOT', begin='<|im_start|>assistant\n', end='<|im_end|>\n', generate=True), ], eos_token_id=92542 ) @@ -31,6 +31,6 @@ batch_size=8, meta_template=_meta_template, run_cfg=dict(num_gpus=1, num_procs=1), - end_str='[UNUSED_TOKEN_145]', + end_str='<|im_end|>', ) ]