Skip to content

Commit

Permalink
fix: 修复本地模型加载失败时,错误信息未输出
Browse files Browse the repository at this point in the history
  • Loading branch information
shaohuzhang1 committed Sep 20, 2024
1 parent 7bd8201 commit b8c5167
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def embed_query(self, text: str) -> List[float]:
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")}'
Expand All @@ -44,7 +44,7 @@ def embed_documents(self, texts: List[str]) -> List[List[float]]:
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):
Expand Down

0 comments on commit b8c5167

Please sign in to comment.