mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-20 17:29:06 +08:00
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)
This commit is contained in:
parent
5beb022ee1
commit
4c9a3e918f
@ -264,7 +264,7 @@ def add_llm():
|
|||||||
try:
|
try:
|
||||||
with open(os.path.join(get_project_base_directory(), "web/src/assets/yay.jpg"), "rb") as f:
|
with open(os.path.join(get_project_base_directory(), "web/src/assets/yay.jpg"), "rb") as f:
|
||||||
m, tc = mdl.describe(f.read())
|
m, tc = mdl.describe(f.read())
|
||||||
if not tc:
|
if not m and not tc:
|
||||||
raise Exception(m)
|
raise Exception(m)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg += f"\nFail to access model({mdl_nm})." + str(e)
|
msg += f"\nFail to access model({mdl_nm})." + str(e)
|
||||||
|
@ -162,6 +162,7 @@ class GptV4(Base):
|
|||||||
)
|
)
|
||||||
return res.choices[0].message.content.strip(), res.usage.total_tokens
|
return res.choices[0].message.content.strip(), res.usage.total_tokens
|
||||||
|
|
||||||
|
|
||||||
class AzureGptV4(Base):
|
class AzureGptV4(Base):
|
||||||
def __init__(self, key, model_name, lang="Chinese", **kwargs):
|
def __init__(self, key, model_name, lang="Chinese", **kwargs):
|
||||||
api_key = json.loads(key).get('api_key', '')
|
api_key = json.loads(key).get('api_key', '')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user