diff --git a/api/apps/llm_app.py b/api/apps/llm_app.py index 3f5357cfa..d14f6fa15 100644 --- a/api/apps/llm_app.py +++ b/api/apps/llm_app.py @@ -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) diff --git a/rag/llm/cv_model.py b/rag/llm/cv_model.py index cd3163f02..2ef0cb54a 100644 --- a/rag/llm/cv_model.py +++ b/rag/llm/cv_model.py @@ -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() diff --git a/rag/settings.py b/rag/settings.py index 06d09f21f..6c2017dc1 100644 --- a/rag/settings.py +++ b/rag/settings.py @@ -54,8 +54,10 @@ elif STORAGE_IMPL_TYPE == 'OSS': try: REDIS = decrypt_database_config(name="redis") except Exception: - REDIS = {} - pass + try: + REDIS = get_base_config("redis", {}) + except Exception: + REDIS = {} 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))