浏览代码

fix zhipuCV bug (#2215)

### What problem does this PR solve?

#2198  fix zhipuCV bug

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: Zhedong Cen <cenzhedong2@126.com>
tags/v0.11.0
黄腾 1年前
父节点
当前提交
2871455e4e
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      rag/llm/cv_model.py

+ 4
- 1
rag/llm/cv_model.py 查看文件

@@ -293,9 +293,12 @@ class Zhipu4V(Base):
def describe(self, image, max_tokens=1024):
b64 = self.image2base64(image)

prompt = self.prompt(b64)
prompt[0]["content"][1]["type"] = "text"
res = self.client.chat.completions.create(
model=self.model_name,
messages=self.prompt(b64),
messages=prompt,
max_tokens=max_tokens,
)
return res.choices[0].message.content.strip(), res.usage.total_tokens

正在加载...
取消
保存