From 03afd39d467f7e26716a12de498f45f17a8cc3bf Mon Sep 17 00:00:00 2001 From: chaofan <60506625+545999961@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:01:28 +0800 Subject: [PATCH] Update lightweight.py --- FlagEmbedding/inference/reranker/decoder_only/lightweight.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FlagEmbedding/inference/reranker/decoder_only/lightweight.py b/FlagEmbedding/inference/reranker/decoder_only/lightweight.py index a9bea311..722b1aa6 100644 --- a/FlagEmbedding/inference/reranker/decoder_only/lightweight.py +++ b/FlagEmbedding/inference/reranker/decoder_only/lightweight.py @@ -435,7 +435,7 @@ def compute_score_single_gpu( if normalize: all_scores[i] = [sigmoid(score) for score in all_scores[i]] - if isinstance(all_scores[0], list): + if len(all_scores) == 1 and isinstance(all_scores[0], list): all_scores = all_scores[0] return all_scores