Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,194 Bytes
a108184 99caed3 a108184 99caed3 a108184 99caed3 a108184 99caed3 a108184 99caed3 a108184 99caed3 a108184 99caed3 a108184 99caed3 a108184 99caed3 a108184 |
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 |
from llama_cpp_agent.messages_formatter import MessagesFormatter, PromptMarkers, Roles
mistral_v1_markers = {
Roles.system: PromptMarkers(""" [INST]""", """ [/INST]"""),
Roles.user: PromptMarkers(""" [INST]""", """ [/INST]"""),
Roles.assistant: PromptMarkers(""" """, """</s>"""),
Roles.tool: PromptMarkers("", ""),
}
mistral_v1_formatter = MessagesFormatter(
"",
mistral_v1_markers,
False,
["</s>"],
)
mistral_v2_markers = {
Roles.system: PromptMarkers("""[INST] """, """[/INST]"""),
Roles.user: PromptMarkers("""[INST] """, """[/INST]"""),
Roles.assistant: PromptMarkers(""" """, """</s>"""),
Roles.tool: PromptMarkers("", ""),
}
mistral_v2_formatter = MessagesFormatter(
"",
mistral_v2_markers,
False,
["</s>"],
)
mistral_v3_tekken_markers = {
Roles.system: PromptMarkers("""[INST]""", """[/INST]"""),
Roles.user: PromptMarkers("""[INST]""", """[/INST]"""),
Roles.assistant: PromptMarkers("""""", """</s>"""),
Roles.tool: PromptMarkers("", ""),
}
mistral_v3_tekken_formatter = MessagesFormatter(
"",
mistral_v3_tekken_markers,
False,
["</s>"],
)
|