From 62152891f5f9711ce81cee3424061e6b81263672 Mon Sep 17 00:00:00 2001 From: hanhainebula <2512674094@qq.com> Date: Mon, 13 Jan 2025 14:51:27 +0800 Subject: [PATCH] fix a bug in icl/dataset.py --- FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py b/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py index 43cc8013..e04dc2ad 100644 --- a/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py +++ b/FlagEmbedding/finetune/embedder/decoder_only/icl/dataset.py @@ -125,8 +125,9 @@ def _create_batch_data(self, batch_raw_data): passages.extend(tmp_passages) - if len(teacher_scores) > 0 and len(passages) > 0: - assert len(teacher_scores) == len(passages) + if teacher_scores is not None: + if len(teacher_scores) > 0 and len(passages) > 0: + assert len(teacher_scores) == len(passages) # add icl pairs if self.args.retrieval_use_examples or (