From 4e636fe418253f1d1e7f4a6d5dd6f9f6167f7e0d Mon Sep 17 00:00:00 2001 From: chaofan <60506625+545999961@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:01:13 +0800 Subject: [PATCH] Update layerwise.py --- FlagEmbedding/inference/reranker/decoder_only/layerwise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FlagEmbedding/inference/reranker/decoder_only/layerwise.py b/FlagEmbedding/inference/reranker/decoder_only/layerwise.py index 8e50271f..9a3e2301 100644 --- a/FlagEmbedding/inference/reranker/decoder_only/layerwise.py +++ b/FlagEmbedding/inference/reranker/decoder_only/layerwise.py @@ -374,7 +374,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