(
messages: List[llama_types.ChatCompletionRequestMessage],
**kwargs: Any,
)
| 1265 | |
| 1266 | @register_chat_format("open-orca") |
| 1267 | def format_open_orca( |
| 1268 | messages: List[llama_types.ChatCompletionRequestMessage], |
| 1269 | **kwargs: Any, |
| 1270 | ) -> ChatFormatterResponse: |
| 1271 | system_template = "{system_message}" |
| 1272 | system_message = ( |
| 1273 | "You are a helpful assistant. Please answer truthfully and write out your " |
| 1274 | "thinking step by step to be sure you get the right answer. If you make a mistake or encounter " |
| 1275 | "an error in your thinking, say so out loud and attempt to correct it. If you don't know or " |
| 1276 | "aren't sure about something, say so clearly. You will act as a professional logician, mathematician, " |
| 1277 | "and physicist. You will also act as the most appropriate type of expert to answer any particular " |
| 1278 | "question or solve the relevant problem; state which expert type your are, if so. Also think of " |
| 1279 | "any particular named expert that would be ideal to answer the relevant question or solve the " |
| 1280 | "relevant problem; name and act as them, if appropriate." |
| 1281 | ) |
| 1282 | roles = ("User", "Assistant") |
| 1283 | sep = "<|end_of_turn|>\n" |
| 1284 | # stop_token_ids=[32000, 32001], # "<|end_of_turn|>" |
| 1285 | stop_str = "User" |
| 1286 | system_message = system_template.format(system_message=system_message) |
| 1287 | _messages = _map_roles(messages, dict(zip(roles, roles))) |
| 1288 | _messages.append((roles[1], None)) |
| 1289 | _prompt = _format_add_colon_space_single(system_message, _messages, sep) |
| 1290 | return ChatFormatterResponse(prompt=_prompt, stop=stop_str) |
| 1291 | |
| 1292 | |
| 1293 | @register_chat_format("mistrallite") |
nothing calls this directly
no test coverage detected
searching dependent graphs…