Parcourir la source

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)
tags/v0.14.0
Kevin Hu il y a 1 an
Parent
révision
18ae8a4091
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3
    0
      api/db/services/dialog_service.py

+ 3
- 0
api/db/services/dialog_service.py Voir le fichier

@@ -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:

Chargement…
Annuler
Enregistrer