浏览代码

Fix: add image2text issue. (#5431)

### What problem does this PR solve?

#5356

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.17.0
Kevin Hu 8 个月前
父节点
当前提交
4c9a3e918f
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1
    1
      api/apps/llm_app.py
  2. 1
    0
      rag/llm/cv_model.py

+ 1
- 1
api/apps/llm_app.py 查看文件

@@ -264,7 +264,7 @@ def add_llm():
try:
with open(os.path.join(get_project_base_directory(), "web/src/assets/yay.jpg"), "rb") as f:
m, tc = mdl.describe(f.read())
if not tc:
if not m and not tc:
raise Exception(m)
except Exception as e:
msg += f"\nFail to access model({mdl_nm})." + str(e)

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

@@ -162,6 +162,7 @@ class GptV4(Base):
)
return res.choices[0].message.content.strip(), res.usage.total_tokens


class AzureGptV4(Base):
def __init__(self, key, model_name, lang="Chinese", **kwargs):
api_key = json.loads(key).get('api_key', '')

正在加载...
取消
保存