support GPTQ tuning #729 #1481 #1545 , fix chatglm template #1453 #1480 #1569

Former-commit-id: fdccc6cc9b68890199e9250cabdb996ff2f853b9
This commit is contained in:
hiyouga
2023-11-20 22:52:11 +08:00
parent 28258aecd2
commit 0105cd48f2
5 changed files with 43 additions and 4 deletions

View File

@@ -354,6 +354,35 @@ register_template(
"\n",
"{{system}}"
],
prompt=[
{"token": "<|user|>"},
"\n",
"{{query}}",
{"token": "<|assistant|>"},
"\n" # add an extra newline to avoid error in ChatGLM's process_response method
],
system=(
"You are ChatGLM3, a large language model trained by Zhipu.AI. "
"Follow the user's instructions carefully. Respond using markdown."
),
sep=[],
stop_words=[
"<|user|>",
"<|observation|>"
],
efficient_eos=True
)
register_template(
name="chatglm3_raw", # the raw template for tool tuning
prefix=[
{"token": "[gMASK]"},
{"token": "sop"},
{"token": "<|system|>"},
"\n",
"{{system}}"
],
prompt=[
{"token": "<|user|>"},
"\n",