Skip to content

Commit

Permalink
raise exception if embedding model not found (infiniflow#3199)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

infiniflow#3173 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored and jhaiq committed Nov 30, 2024
1 parent c1aea9c commit 897c5ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/db/services/dialog_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ def chat(dialog, messages, stream=True, **kwargs):
attachments.extend(m["doc_ids"])

embd_mdl = LLMBundle(dialog.tenant_id, LLMType.EMBEDDING, embd_nms[0])
if not embd_mdl:
raise LookupError("Embedding model(%s) not found" % embd_nms[0])

if llm_id2llm_type(dialog.llm_id) == "image2text":
chat_mdl = LLMBundle(dialog.tenant_id, LLMType.IMAGE2TEXT, dialog.llm_id)
else:
Expand Down

0 comments on commit 897c5ec

Please sign in to comment.