mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-29 16:12:55 +00:00
fix: 修复本地模型加载失败时,错误信息未输出
This commit is contained in:
parent
a980604617
commit
b8d1512eca
|
|
@ -35,7 +35,7 @@ class WebLocalEmbedding(MaxKBBaseModel, BaseModel, Embeddings):
|
|||
result = res.json()
|
||||
if result.get('code', 500) == 200:
|
||||
return result.get('data')
|
||||
raise Exception(result.get('msg'))
|
||||
raise Exception(result.get('message'))
|
||||
|
||||
def embed_documents(self, texts: List[str]) -> List[List[float]]:
|
||||
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
|
||||
|
|
@ -44,7 +44,7 @@ class WebLocalEmbedding(MaxKBBaseModel, BaseModel, Embeddings):
|
|||
result = res.json()
|
||||
if result.get('code', 500) == 200:
|
||||
return result.get('data')
|
||||
raise Exception(result.get('msg'))
|
||||
raise Exception(result.get('message'))
|
||||
|
||||
|
||||
class LocalEmbedding(MaxKBBaseModel, HuggingFaceEmbeddings):
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class WebLocalBaseReranker(MaxKBBaseModel, BaseDocumentCompressor):
|
|||
if result.get('code', 500) == 200:
|
||||
return [Document(page_content=document.get('page_content'), metadata=document.get('metadata')) for document
|
||||
in result.get('data')]
|
||||
raise Exception(result.get('msg'))
|
||||
raise Exception(result.get('message'))
|
||||
|
||||
|
||||
class LocalBaseReranker(MaxKBBaseModel, BaseDocumentCompressor):
|
||||
|
|
|
|||
Loading…
Reference in New Issue