mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
raise exception if embedding model not found (#3199)
### What problem does this PR solve? #3173 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -162,6 +162,9 @@ def chat(dialog, messages, stream=True, **kwargs):
|
|||||||
attachments.extend(m["doc_ids"])
|
attachments.extend(m["doc_ids"])
|
||||||
|
|
||||||
embd_mdl = LLMBundle(dialog.tenant_id, LLMType.EMBEDDING, embd_nms[0])
|
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":
|
if llm_id2llm_type(dialog.llm_id) == "image2text":
|
||||||
chat_mdl = LLMBundle(dialog.tenant_id, LLMType.IMAGE2TEXT, dialog.llm_id)
|
chat_mdl = LLMBundle(dialog.tenant_id, LLMType.IMAGE2TEXT, dialog.llm_id)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user