fix issue: query is none when doing retrieval (#10129)

This commit is contained in:
Jyong 2024-10-31 21:25:00 +08:00 committed by Joel
parent ae3482e0b4
commit 1b645c1cc9

View File

@ -34,6 +34,8 @@ class RetrievalService:
reranking_mode: Optional[str] = "reranking_model", reranking_mode: Optional[str] = "reranking_model",
weights: Optional[dict] = None, weights: Optional[dict] = None,
): ):
if not query:
return []
dataset = db.session.query(Dataset).filter(Dataset.id == dataset_id).first() dataset = db.session.query(Dataset).filter(Dataset.id == dataset_id).first()
if not dataset: if not dataset:
return [] return []