增加加了博物馆展品清单数据库及对前端获取展品清单、展品详细的接口,增加了QWenOmni多模态大模型的支 持(主要为了测试),增加了本地部署大模型支持(主要为了测试,在autoDL上),修正了TTS生成和返回前端的逻辑与参数,增加了判断用户问题有没有在知识库中检索到相关片段、如果没有则直接返回并提示未包含

This commit is contained in:
qcloud
2025-04-08 08:41:07 +08:00
parent a5e83f4d3b
commit 330976812d
12 changed files with 593 additions and 158 deletions

View File

@@ -203,11 +203,14 @@ class ZhipuEmbed(Base):
def encode(self, texts: list, batch_size=16):
arr = []
tks_num = 0
for txt in texts:
res = self.client.embeddings.create(input=txt,
model=self.model_name)
arr.append(res.data[0].embedding)
tks_num += res.usage.total_tokens
try:
for txt in texts:
res = self.client.embeddings.create(input=txt,
model=self.model_name)
arr.append(res.data[0].embedding)
tks_num += res.usage.total_tokens
except Exception as error:
logging.info(f"!!!ZhipuEmbed embedding error {error}")
return np.array(arr), tks_num
def encode_queries(self, text):