John6666 commited on
Commit
99caed3
β€’
1 Parent(s): 9910d3a

Upload formatter.py

Browse files
Files changed (1) hide show
  1. formatter.py +18 -18
formatter.py CHANGED
@@ -1,43 +1,43 @@
1
  from llama_cpp_agent.messages_formatter import MessagesFormatter, PromptMarkers, Roles
2
 
3
  mistral_v1_markers = {
4
- Roles.system: PromptMarkers(""" [INST]""", """ [/INST] Understood.</s>"""),
5
  Roles.user: PromptMarkers(""" [INST]""", """ [/INST]"""),
6
- Roles.assistant: PromptMarkers(" ", "</s>"),
7
  Roles.tool: PromptMarkers("", ""),
8
  }
9
 
10
  mistral_v1_formatter = MessagesFormatter(
11
- pre_prompt="",
12
- prompt_markers=mistral_v1_markers,
13
- include_sys_prompt_in_first_user_message=False,
14
- default_stop_sequences=["</s>"]
15
  )
16
 
17
  mistral_v2_markers = {
18
- Roles.system: PromptMarkers("""[INST] """, """[/INST] Understood.</s>"""),
19
  Roles.user: PromptMarkers("""[INST] """, """[/INST]"""),
20
- Roles.assistant: PromptMarkers(" ", "</s>"),
21
  Roles.tool: PromptMarkers("", ""),
22
  }
23
 
24
  mistral_v2_formatter = MessagesFormatter(
25
- pre_prompt="",
26
- prompt_markers=mistral_v2_markers,
27
- include_sys_prompt_in_first_user_message=False,
28
- default_stop_sequences=["</s>"]
29
  )
30
 
31
  mistral_v3_tekken_markers = {
32
- Roles.system: PromptMarkers("""[INST]""", """[/INST]Understood.</s>"""),
33
  Roles.user: PromptMarkers("""[INST]""", """[/INST]"""),
34
- Roles.assistant: PromptMarkers("", "</s>"),
35
  Roles.tool: PromptMarkers("", ""),
36
  }
37
 
38
  mistral_v3_tekken_formatter = MessagesFormatter(
39
- pre_prompt="",
40
- prompt_markers=mistral_v3_tekken_markers,
41
- include_sys_prompt_in_first_user_message=False,
42
- default_stop_sequences=["</s>"]
43
  )
 
1
  from llama_cpp_agent.messages_formatter import MessagesFormatter, PromptMarkers, Roles
2
 
3
  mistral_v1_markers = {
4
+ Roles.system: PromptMarkers(""" [INST]""", """ [/INST]"""),
5
  Roles.user: PromptMarkers(""" [INST]""", """ [/INST]"""),
6
+ Roles.assistant: PromptMarkers(""" """, """</s>"""),
7
  Roles.tool: PromptMarkers("", ""),
8
  }
9
 
10
  mistral_v1_formatter = MessagesFormatter(
11
+ "",
12
+ mistral_v1_markers,
13
+ False,
14
+ ["</s>"],
15
  )
16
 
17
  mistral_v2_markers = {
18
+ Roles.system: PromptMarkers("""[INST] """, """[/INST]"""),
19
  Roles.user: PromptMarkers("""[INST] """, """[/INST]"""),
20
+ Roles.assistant: PromptMarkers(""" """, """</s>"""),
21
  Roles.tool: PromptMarkers("", ""),
22
  }
23
 
24
  mistral_v2_formatter = MessagesFormatter(
25
+ "",
26
+ mistral_v2_markers,
27
+ False,
28
+ ["</s>"],
29
  )
30
 
31
  mistral_v3_tekken_markers = {
32
+ Roles.system: PromptMarkers("""[INST]""", """[/INST]"""),
33
  Roles.user: PromptMarkers("""[INST]""", """[/INST]"""),
34
+ Roles.assistant: PromptMarkers("""""", """</s>"""),
35
  Roles.tool: PromptMarkers("", ""),
36
  }
37
 
38
  mistral_v3_tekken_formatter = MessagesFormatter(
39
+ "",
40
+ mistral_v3_tekken_markers,
41
+ False,
42
+ ["</s>"],
43
  )