Spaces:
Running
on
Zero
Running
on
Zero
Upload formatter.py
Browse files- 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]
|
5 |
Roles.user: PromptMarkers(""" [INST]""", """ [/INST]"""),
|
6 |
-
Roles.assistant: PromptMarkers(" ", "</s>"),
|
7 |
Roles.tool: PromptMarkers("", ""),
|
8 |
}
|
9 |
|
10 |
mistral_v1_formatter = MessagesFormatter(
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
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 |
-
|
27 |
-
|
28 |
-
|
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 |
-
|
41 |
-
|
42 |
-
|
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 |
)
|