Parcourir la source

fix tongyi embedding endpoint return None output (#10857)

Jyong il y a 5 mois
Parent
commit
bd05df5cc5

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