From 6311b9b5abc7bf66b4bbec069c6119aa028da091 Mon Sep 17 00:00:00 2001 From: Koga Kobayashi Date: Mon, 26 Jun 2023 14:28:37 +0900 Subject: [PATCH 1/2] Fix get_prompt_and_rejected in CohereMiracljaqueries2212Dataset --- .../DeepSpeed-Chat/training/utils/data/raw_datasets.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py b/applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py index e8c519a8f..4038a6d25 100644 --- a/applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py +++ b/applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py @@ -689,9 +689,10 @@ def get_prompt_and_chosen(self, sample): 'positive_passages'][0]['text'] def get_prompt_and_rejected(self, sample): - return " Human: " + sample['query'] + " Assistant: " + sample[ - 'negative_passages'][0]['text'] - + if len(sample['negative_passages']) > 0: + return " Human: " + sample['query'] + " Assistant: " + sample[ + 'negative_passages'][0]['text'] + return None # Japanese dataset class LmqgQgjaquadDataset(PromptRawDataset): From 856abe35a4df07d1b31696f9098557a5e33459e6 Mon Sep 17 00:00:00 2001 From: Koga Kobayashi Date: Mon, 26 Jun 2023 17:53:20 +0900 Subject: [PATCH 2/2] Reformat code using yapf --- applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py b/applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py index 4038a6d25..3c84f4b07 100644 --- a/applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py +++ b/applications/DeepSpeed-Chat/training/utils/data/raw_datasets.py @@ -694,6 +694,7 @@ def get_prompt_and_rejected(self, sample): 'negative_passages'][0]['text'] return None + # Japanese dataset class LmqgQgjaquadDataset(PromptRawDataset):