(
messages: List[llama_types.ChatCompletionRequestMessage],
**kwargs: Any,
)
| 1113 | |
| 1114 | @register_chat_format("vicuna") |
| 1115 | def format( |
| 1116 | messages: List[llama_types.ChatCompletionRequestMessage], |
| 1117 | **kwargs: Any, |
| 1118 | ) -> ChatFormatterResponse: |
| 1119 | _system_message = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions." |
| 1120 | _roles = dict(user="USER", assistant="ASSISTANT") |
| 1121 | _sep = " " |
| 1122 | _sep2 = "</s>" |
| 1123 | system_message = _system_message |
| 1124 | _messages = _map_roles(messages, _roles) |
| 1125 | _messages.append((_roles["assistant"], None)) |
| 1126 | _prompt = _format_add_colon_two(system_message, _messages, _sep, _sep2) |
| 1127 | return ChatFormatterResponse(prompt=_prompt) |
| 1128 | |
| 1129 | |
| 1130 | @register_chat_format("oasst_llama") |
no test coverage detected
searching dependent graphs…