Skip to content

Commit

Permalink
fixed score threshold is none (#8342)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong authored Sep 13, 2024
1 parent c78828a commit 49cee77
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/core/rag/retrieval/dataset_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def _retriever(self, flask_app: Flask, dataset_id: str, query: str, top_k: int,
top_k=top_k,
score_threshold=retrieval_model.get("score_threshold", 0.0)
if retrieval_model["score_threshold_enabled"]
else None,
else 0.0,
reranking_model=retrieval_model.get("reranking_model", None)
if retrieval_model["reranking_enable"]
else None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _retriever(
top_k=self.top_k,
score_threshold=retrieval_model.get("score_threshold", 0.0)
if retrieval_model["score_threshold_enabled"]
else None,
else 0.0,
reranking_model=retrieval_model.get("reranking_model", None)
if retrieval_model["reranking_enable"]
else None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _run(self, query: str) -> str:
top_k=self.top_k,
score_threshold=retrieval_model.get("score_threshold", 0.0)
if retrieval_model["score_threshold_enabled"]
else None,
else 0.0,
reranking_model=retrieval_model.get("reranking_model", None)
if retrieval_model["reranking_enable"]
else None,
Expand Down
2 changes: 1 addition & 1 deletion api/services/hit_testing_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def retrieve(cls, dataset: Dataset, query: str, account: Account, retrieval_mode
top_k=retrieval_model.get("top_k", 2),
score_threshold=retrieval_model.get("score_threshold", 0.0)
if retrieval_model["score_threshold_enabled"]
else None,
else 0.0,
reranking_model=retrieval_model.get("reranking_model", None)
if retrieval_model["reranking_enable"]
else None,
Expand Down

0 comments on commit 49cee77

Please sign in to comment.