Skip to content

Commit

Permalink
Added empty index check
Browse files Browse the repository at this point in the history
  • Loading branch information
szczyglis-dev committed Feb 3, 2025
1 parent 0d5d593 commit 00a89c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pygpt_net/core/idx/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ def chat(
else:
llm = self.window.core.idx.llm.get(model)

# check if index is empty
if index:
nodes = index.docstore.docs.values()
if not nodes:
use_index = False

# TODO: if multimodal support, try to get multimodal provider
# if model.is_multimodal():
# llm = self.window.core.idx.llm.get(model, multimodal=True) # get multimodal LLM model
Expand Down

0 comments on commit 00a89c1

Please sign in to comment.