From a0b08a465a255bf4529b70bd09f407211a82cc2a Mon Sep 17 00:00:00 2001 From: Shashank Rajput Date: Wed, 27 Nov 2024 12:45:19 -0800 Subject: [PATCH] .. --- llmfoundry/data/finetuning/tasks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/llmfoundry/data/finetuning/tasks.py b/llmfoundry/data/finetuning/tasks.py index bda19c9b5e..02af7c09f3 100644 --- a/llmfoundry/data/finetuning/tasks.py +++ b/llmfoundry/data/finetuning/tasks.py @@ -1179,3 +1179,13 @@ def QA_format_preprocessor(inp: dict) -> ChatFormattedDict: except Exception as e: raise UnableToProcessPromptResponseError(inp) from e return {'messages': messages} + + +@dataset_constructor.register('abc/msg') +def messages_format_preprocessor(inp: dict) -> ChatFormattedDict: + """Convert from QA format to our chat format.""" + try: + messages = inp['messages'] + except Exception as e: + raise UnableToProcessPromptResponseError(inp) from e + return {'messages': messages}