Skip to content

Commit f6ad847

Browse files
committed
fix: Use logger print log
1 parent 9b1a778 commit f6ad847

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

dbgpt/storage/vector_store/milvus_store.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,7 @@ def similar_search_with_scores(self, text, topk, score_threshold) -> List[Chunk]
339339
self.vector_field = x.name
340340
_, docs_and_scores = self._search(text, topk)
341341
if any(score < 0.0 or score > 1.0 for _, score, id in docs_and_scores):
342-
import warnings
343-
344-
warnings.warn(
342+
logger.warning(
345343
"similarity score need between" f" 0 and 1, got {docs_and_scores}"
346344
)
347345

@@ -357,7 +355,7 @@ def similar_search_with_scores(self, text, topk, score_threshold) -> List[Chunk]
357355
if score >= score_threshold
358356
]
359357
if len(docs_and_scores) == 0:
360-
warnings.warn(
358+
logger.warning(
361359
"No relevant docs were retrieved using the relevance score"
362360
f" threshold {score_threshold}"
363361
)

0 commit comments

Comments
 (0)