优化一些错误提示
This commit is contained in:
parent
abed50685c
commit
b7d5532e2a
@ -12,9 +12,6 @@ services:
|
|||||||
# - ${MODEL_DIR}:/models # 如果出现 undefined volume MODEL_DIR: invalid compose project,请添加此环境变量或者注释此行
|
# - ${MODEL_DIR}:/models # 如果出现 undefined volume MODEL_DIR: invalid compose project,请添加此环境变量或者注释此行
|
||||||
ports:
|
ports:
|
||||||
- "5050:5050"
|
- "5050:5050"
|
||||||
depends_on:
|
|
||||||
- graph
|
|
||||||
- milvus
|
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
|
|||||||
@ -126,7 +126,7 @@ class Config(SimpleConfig):
|
|||||||
if os.path.exists(self.model_dir):
|
if os.path.exists(self.model_dir):
|
||||||
logger.info(f"MODEL_DIR ({self.model_dir}) 下面的文件夹: {os.listdir(self.model_dir)}")
|
logger.info(f"MODEL_DIR ({self.model_dir}) 下面的文件夹: {os.listdir(self.model_dir)}")
|
||||||
else:
|
else:
|
||||||
logger.warning(f"MODEL_DIR ({self.model_dir}) 不存在,请检查是否配置正确,比如 docker-compose 文件中的映射")
|
logger.warning(f"提醒:MODEL_DIR ({self.model_dir}) 不存在,如果未配置,请忽略,如果配置了,请检查是否配置正确,比如 docker-compose 文件中的映射")
|
||||||
|
|
||||||
|
|
||||||
# 检查模型提供商是否存在
|
# 检查模型提供商是否存在
|
||||||
|
|||||||
@ -418,7 +418,7 @@ class GraphDatabase:
|
|||||||
with open(info_file_path, 'w', encoding='utf-8') as f:
|
with open(info_file_path, 'w', encoding='utf-8') as f:
|
||||||
json.dump(graph_info, f, ensure_ascii=False, indent=2)
|
json.dump(graph_info, f, ensure_ascii=False, indent=2)
|
||||||
|
|
||||||
logger.info(f"图数据库信息已保存到:{info_file_path}")
|
# logger.info(f"图数据库信息已保存到:{info_file_path}")
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"保存图数据库信息失败:{e}")
|
logger.error(f"保存图数据库信息失败:{e}")
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class KnowledgeBase:
|
|||||||
try:
|
try:
|
||||||
milvus_info = self.get_collection_info(db["db_id"])
|
milvus_info = self.get_collection_info(db["db_id"])
|
||||||
db_copy["metadata"] = milvus_info
|
db_copy["metadata"] = milvus_info
|
||||||
logger.debug(f"获取知识库 {db['name']} (ID: {db['db_id']}) 的Milvus信息成功: {milvus_info}")
|
# logger.debug(f"获取知识库 {db['name']} (ID: {db['db_id']}) 的Milvus信息成功: {milvus_info}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"获取知识库 {db['name']} (ID: {db['db_id']}) 的Milvus信息失败: {e}")
|
logger.warning(f"获取知识库 {db['name']} (ID: {db['db_id']}) 的Milvus信息失败: {e}")
|
||||||
# 添加一个默认的Milvus状态
|
# 添加一个默认的Milvus状态
|
||||||
@ -390,7 +390,7 @@ class KnowledgeBase:
|
|||||||
logger.info(f"Successfully connected to Milvus at {uri}")
|
logger.info(f"Successfully connected to Milvus at {uri}")
|
||||||
return True
|
return True
|
||||||
except MilvusException as e:
|
except MilvusException as e:
|
||||||
logger.error(f"Failed to connect to Milvus: {e}")
|
logger.error(f"Failed to connect to Milvus: {e},请检查 milvus 的容器是否正常运行,如果已退出,请重新启动 `docker restart milvus-standalone-dev`")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_collection_names(self):
|
def get_collection_names(self):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user