Error msg for sharegpt if conv has less than 2 msg (#379)

This commit is contained in:
florian peyron
2023-08-14 10:40:40 +02:00
committed by GitHub
parent fdffef5940
commit 63fdb5a7fb

View File

@@ -312,7 +312,9 @@ class ShareGPTPrompter: # pylint: disable=too-few-public-methods
if len(source) < 2:
# If there isn't a back and forth conversation, ignore it
# also happens on the data splitting leaving empty conversations
raise IndexError
raise IndexError(
f"A conversation entry has less than 2 messages :\n{source}"
)
conv = self._conversation.copy()
roles = {"human": conv.roles[0], "gpt": conv.roles[1]}