diff --git a/xtuner/dataset/map_fns/dataset_map_fns/openai_map_fn.py b/xtuner/dataset/map_fns/dataset_map_fns/openai_map_fn.py index c1798dc45..468e738f7 100644 --- a/xtuner/dataset/map_fns/dataset_map_fns/openai_map_fn.py +++ b/xtuner/dataset/map_fns/dataset_map_fns/openai_map_fn.py @@ -32,7 +32,8 @@ def openai_map_fn(example): elif msg['role'] == 'user': input += msg['content'] elif msg['role'] == 'assistant': - output_with_loss = msg.get('loss', True) + output_with_loss = msg.get('loss', 'True') + output_with_loss = str(output_with_loss) output_with_loss = output_with_loss.lower() == 'true' conversation.append({ 'system': system,