mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: allow initialize Redis without password (#10856)
### What problem does this PR solve? Allow initialize Redis without password. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -264,7 +264,7 @@ def add_llm():
|
|||||||
try:
|
try:
|
||||||
image_data = test_image
|
image_data = test_image
|
||||||
m, tc = mdl.describe(image_data)
|
m, tc = mdl.describe(image_data)
|
||||||
if not m and not tc:
|
if not tc and m.find("**ERROR**:") >= 0:
|
||||||
raise Exception(m)
|
raise Exception(m)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg += f"\nFail to access model({factory}/{mdl_nm})." + str(e)
|
msg += f"\nFail to access model({factory}/{mdl_nm})." + str(e)
|
||||||
|
|||||||
@ -526,7 +526,7 @@ class OllamaCV(Base):
|
|||||||
try:
|
try:
|
||||||
response = self.client.generate(
|
response = self.client.generate(
|
||||||
model=self.model_name,
|
model=self.model_name,
|
||||||
prompt=prompt[0]["content"][0]["text"],
|
prompt=prompt[0]["content"],
|
||||||
images=[image],
|
images=[image],
|
||||||
)
|
)
|
||||||
ans = response["response"].strip()
|
ans = response["response"].strip()
|
||||||
|
|||||||
@ -53,9 +53,11 @@ elif STORAGE_IMPL_TYPE == 'OSS':
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
REDIS = decrypt_database_config(name="redis")
|
REDIS = decrypt_database_config(name="redis")
|
||||||
|
except Exception:
|
||||||
|
try:
|
||||||
|
REDIS = get_base_config("redis", {})
|
||||||
except Exception:
|
except Exception:
|
||||||
REDIS = {}
|
REDIS = {}
|
||||||
pass
|
|
||||||
DOC_MAXIMUM_SIZE = int(os.environ.get("MAX_CONTENT_LENGTH", 128 * 1024 * 1024))
|
DOC_MAXIMUM_SIZE = int(os.environ.get("MAX_CONTENT_LENGTH", 128 * 1024 * 1024))
|
||||||
DOC_BULK_SIZE = int(os.environ.get("DOC_BULK_SIZE", 4))
|
DOC_BULK_SIZE = int(os.environ.get("DOC_BULK_SIZE", 4))
|
||||||
EMBEDDING_BATCH_SIZE = int(os.environ.get("EMBEDDING_BATCH_SIZE", 16))
|
EMBEDDING_BATCH_SIZE = int(os.environ.get("EMBEDDING_BATCH_SIZE", 16))
|
||||||
|
|||||||
Reference in New Issue
Block a user