mirror of
https://github.com/csunny/DB-GPT.git
synced 2026-07-16 17:15:22 +00:00
fix(rag): correct empty/non-list guard in TeiRerankEmbeddings._parse_results (#3133)
This commit is contained in:
committed by
GitHub
parent
f5adbef2ac
commit
7996544a43
@@ -643,7 +643,7 @@ class TeiRerankEmbeddings(OpenAPIRerankEmbeddings):
|
||||
Returns:
|
||||
List[float]: The rank scores of the candidates.
|
||||
"""
|
||||
if not isinstance(response, list) and len(response) == 0:
|
||||
if not isinstance(response, list) or len(response) == 0:
|
||||
raise RuntimeError("Results should be a not empty list")
|
||||
|
||||
# Sort by index, 0 in the first element
|
||||
|
||||
Reference in New Issue
Block a user