Files
zoujiwen 517691c2d6 上传文件至 kg_lab_6.13
6.18 更新数据配置路径统一,和前端demo
2025-06-18 16:02:47 +08:00

36 lines
1010 B
Python

# import os
# BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# info_data_json = os.path.join(BASE_DIR, 'data/data.json')
# info_data_txt = os.path.join(BASE_DIR, 'data/data.txt')
# info_faiss_archived = os.path.join(BASE_DIR, 'data/faiss_data/data')
# # Neo4j
# neo4j_url = "bolt://172.20.0.145:7687"
# neo4j_username = "neo4j"
# neo4j_password = "password"
import os
import json
# 获取当前目录
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# 读取 config.json 配置文件
config_path = os.path.join(BASE_DIR, 'config.json')
with open(config_path, 'r', encoding='utf-8') as f:
config = json.load(f)
# 解析路径配置
info_data_json = os.path.join(BASE_DIR, config["info_data_json"])
info_data_txt = os.path.join(BASE_DIR, config["info_data_txt"])
info_faiss_archived = os.path.join(BASE_DIR, config["info_faiss_archived"])
# 解析 Neo4j 配置
neo4j_url = config["neo4j"]["url"]
neo4j_username = config["neo4j"]["username"]
neo4j_password = config["neo4j"]["password"]