-
Notifications
You must be signed in to change notification settings - Fork 15
/
meta_template.py
56 lines (56 loc) · 2.08 KB
/
meta_template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
meta_template_dict = dict(
internlm = [
dict(role='system', begin='<|System|>:', end='\n'),
dict(role='user', begin='<|User|>:', end='\n'),
dict(role='function', begin='<|System|>:', end='\n'),
dict(
role='assistant',
begin='<|Bot|>:',
end='<eoa>\n',
generate=True)
],
llama2 = [
dict(role='system', begin='[INST]', end='[\INST]'),
dict(role='user', begin='[INST]', end='[\INST]'),
dict(role='function', begin='[INST]', end='[\INST]'),
dict(role='assistant',
begin='',
end='</s>',
generate=True),
],
qwen = [
dict(role='user', api_role='user', begin='\n<|im_start|>user\n', end='<|im_end|>'),
dict(role='system', api_role='system', begin='\n<|im_start|>user\n', end='<|im_end|>'),
dict(role='function', api_role='user', begin='\n<|im_start|>user\n', end='<|im_end|>'),
dict(role='assistant',
api_role='assistant',
begin='\n<|im_start|>assistant\n',
end='<|im_end|>',
generate=True),
],
vicuna = [
dict(role='user', begin='user: ', end='\n'),
dict(role='system', begin='user: ', end='\n'),
dict(role='function', begin='user: ', end='\n'),
dict(role='assistant',
begin='assistant: ',
end='\n',
generate=True),
],
# we use chat APITemplateParser for chatglm due to some specific designs from ChatGLM
chatglm = [
dict(role='system', api_role='user'),
dict(role='user', api_role='user'),
dict(role='function', api_role='user'),
dict(role='assistant',
api_role='assistant',
generate=True)
],
baichuan = [
dict(role='user', begin='<reserved_106>', end='\n'),
dict(role='system', begin='<reserved_106>', end='\n'),
dict(role='function', begin='<reserved_106>', end='\n'),
dict(role='assistant', begin='<reserved_107>', end='\n',
generate=True),
]
)