mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-07 11:28:09 +02:00
Rerank Handle Null (#2010)
This commit is contained in:
parent
1be1959d80
commit
ca893f9918
@ -36,7 +36,7 @@ POSTGRES_APP_NAME = (
|
||||
_SYNC_ENGINE: Engine | None = None
|
||||
_ASYNC_ENGINE: AsyncEngine | None = None
|
||||
|
||||
SessionFactory = None
|
||||
SessionFactory: sessionmaker[Session] | None = None
|
||||
|
||||
|
||||
def get_db_current_time(db_session: Session) -> datetime:
|
||||
|
@ -236,6 +236,12 @@ def search_postprocessing(
|
||||
) -> Iterator[list[InferenceSection] | list[int]]:
|
||||
post_processing_tasks: list[FunctionCall] = []
|
||||
|
||||
if not retrieved_sections:
|
||||
# Avoids trying to rerank an empty list which throws an error
|
||||
yield []
|
||||
yield []
|
||||
return
|
||||
|
||||
rerank_task_id = None
|
||||
sections_yielded = False
|
||||
if should_rerank(search_query):
|
||||
|
Loading…
x
Reference in New Issue
Block a user