From 25fdee7bc70030a8fa31af00b10b8f52aa3264b5 Mon Sep 17 00:00:00 2001 From: jyong <718720800@qq.com> Date: Tue, 19 Nov 2024 19:50:37 +0800 Subject: [PATCH] fix tongyi embedding endpoint return None output --- 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 c9245bd82ddb08..a5ce9ead6ee3be 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 @@ def _invoke( ) 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(