better handling of llama-3 tool rolw (#1782)

This commit is contained in:
Wing Lian
2024-08-25 12:31:40 -04:00
committed by GitHub
parent 22f4eafa55
commit f245964f22

View File

@@ -352,9 +352,12 @@ class ShareGPTPrompter(Prompter): # pylint: disable=too-few-public-methods
"Please help us by creating an Issue to add support for this conversation type."
)
role = CONVERSATION_ROLE_FORMAT[self._conversation.name].format(
ROLE=from_role
)
if self._conversation.name in ["llama3"]:
role = from_role
else:
role = CONVERSATION_ROLE_FORMAT[self._conversation.name].format(
ROLE=from_role
)
if len(conv.messages) > 0 and ((role == conv.messages[-1][0])):
if (