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:
Yongteng Lei
2025-10-29 09:45:28 +08:00
committed by GitHub
parent 95fad5d523
commit c0c2a10680
3 changed files with 6 additions and 4 deletions

View File

@ -264,7 +264,7 @@ def add_llm():
try:
image_data = test_image
m, tc = mdl.describe(image_data)
if not m and not tc:
if not tc and m.find("**ERROR**:") >= 0:
raise Exception(m)
except Exception as e:
msg += f"\nFail to access model({factory}/{mdl_nm})." + str(e)

View File

@ -526,7 +526,7 @@ class OllamaCV(Base):
try:
response = self.client.generate(
model=self.model_name,
prompt=prompt[0]["content"][0]["text"],
prompt=prompt[0]["content"],
images=[image],
)
ans = response["response"].strip()

View File

@ -54,8 +54,10 @@ elif STORAGE_IMPL_TYPE == 'OSS':
try:
REDIS = decrypt_database_config(name="redis")
except Exception:
try:
REDIS = get_base_config("redis", {})
except Exception:
REDIS = {}
pass
DOC_MAXIMUM_SIZE = int(os.environ.get("MAX_CONTENT_LENGTH", 128 * 1024 * 1024))
DOC_BULK_SIZE = int(os.environ.get("DOC_BULK_SIZE", 4))
EMBEDDING_BATCH_SIZE = int(os.environ.get("EMBEDDING_BATCH_SIZE", 16))