From 93477d08ca672b3704c9e8202b972e1a00c7b681 Mon Sep 17 00:00:00 2001 From: billvsme <994171686@qq.com> Date: Wed, 27 Nov 2024 16:13:13 +0800 Subject: [PATCH 1/2] fix knowledge_distillation=False, len(teacher_scores) error --- FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py b/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py index 43cc8013..2e772e5b 100644 --- a/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py +++ b/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py @@ -125,7 +125,7 @@ def _create_batch_data(self, batch_raw_data): passages.extend(tmp_passages) - if len(teacher_scores) > 0 and len(passages) > 0: + if teacher_scores and len(teacher_scores) > 0 and len(passages) > 0: assert len(teacher_scores) == len(passages) # add icl pairs From 5aa3fc4e93cf70e917e447d861367c8ea97fa129 Mon Sep 17 00:00:00 2001 From: billvsme <994171686@qq.com> Date: Wed, 27 Nov 2024 16:35:39 +0800 Subject: [PATCH 2/2] remove len --- FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py b/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py index 2e772e5b..7fd5e998 100644 --- a/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py +++ b/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py @@ -125,7 +125,7 @@ def _create_batch_data(self, batch_raw_data): passages.extend(tmp_passages) - if teacher_scores and len(teacher_scores) > 0 and len(passages) > 0: + if teacher_scores and passages: assert len(teacher_scores) == len(passages) # add icl pairs