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 GitHub
parent 2ecdc54b0b
commit dad041c49f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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