Преглед на файлове

fix tongyi embedding endpoint return None output (#10857)

Jyong преди 8 месеца
родител
ревизия
bd05df5cc5
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  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(