From bd05df5cc521e2259034fce0079c3408c7fb8df1 Mon Sep 17 00:00:00 2001 From: Jyong <76649700+JohnJyong@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:04:17 +0800 Subject: [PATCH] fix tongyi embedding endpoint return None output (#10857) --- api/core/model_runtime/model_providers/tongyi/rerank/rerank.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py b/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py index c9245bd82d..a5ce9ead6e 100644 --- a/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py +++ b/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py @@ -65,6 +65,8 @@ class GTERerankModel(RerankModel): ) rerank_documents = [] + if not response.output: + return RerankResult(model=model, docs=rerank_documents) for _, result in enumerate(response.output.results): # format document rerank_document = RerankDocument(