Skip to content

Commit

Permalink
fix #1637 (#1638)
Browse files Browse the repository at this point in the history
Co-authored-by: baomi.wbm <[email protected]>
  • Loading branch information
wangbooth and baomi.wbm authored Nov 28, 2023
1 parent 3c37fd3 commit 53be4d2
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import logging
from typing import Optional, List

from langchain.schema import Document
from xinference_client.client.restful.restful_client import Client
from typing import List, Optional

from core.model_providers.error import LLMBadRequestError
from core.model_providers.models.reranking.base import BaseReranking
from core.model_providers.providers.base import BaseModelProvider
from langchain.schema import Document
from xinference_client.client.restful.restful_client import Client


class XinferenceReranking(BaseReranking):
Expand Down Expand Up @@ -48,7 +47,7 @@ def rerank(self, query: str, documents: List[Document], score_threshold: Optiona
)
# score threshold check
if score_threshold is not None:
if result.relevance_score >= score_threshold:
if result['relevance_score'] >= score_threshold:
rerank_documents.append(rerank_document)
else:
rerank_documents.append(rerank_document)
Expand Down

0 comments on commit 53be4d2

Please sign in to comment.