Просмотр исходного кода

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 месяцев назад
Родитель
Сommit
4c9a3e918f
Аккаунт пользователя с таким Email не найден
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', '')

Загрузка…
Отмена
Сохранить