Browse Source

fix tongyi embedding endpoint return None output (#10857)

Jyong 5 months ago
parent
commit
bd05df5cc5
1 changed files with 2 additions and 0 deletions
  1. 2 0
      api/core/model_runtime/model_providers/tongyi/rerank/rerank.py

+ 2 - 0
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(