main
HuangHai 2 weeks ago
parent 5561da6d94
commit ad0f8b2947

@ -0,0 +1,8 @@
https://github.com/HKUDS/LightRAG/issues/1244
# 源码路径
D:\anaconda3\envs\py310\Lib\site-packages\lightrag
# 用VScode打开编辑可以全局搜索
D:\anaconda3\envs\py310\Lib\site-packages\lightrag\kg\postgres_impl.py

File diff suppressed because it is too large Load Diff

@ -21,7 +21,7 @@ logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO)
async def main(): async def main():
try: try:
rag = await initialize_pg_rag(WORKING_DIR=WORKING_DIR,namespace_prefix='huanghai') rag = await initialize_pg_rag(WORKING_DIR=WORKING_DIR)
with open(f"../Txt/sushi.txt", "r", encoding="utf-8") as f: with open(f"../Txt/sushi.txt", "r", encoding="utf-8") as f:
await rag.ainsert(f.read()) await rag.ainsert(f.read())
finally: finally:

@ -152,7 +152,7 @@ os.environ["POSTGRES_PASSWORD"] = POSTGRES_PASSWORD
os.environ["POSTGRES_DATABASE"] = POSTGRES_DATABASE os.environ["POSTGRES_DATABASE"] = POSTGRES_DATABASE
async def initialize_pg_rag(WORKING_DIR, namespace_prefix): async def initialize_pg_rag(WORKING_DIR):
rag = LightRAG( rag = LightRAG(
working_dir=WORKING_DIR, working_dir=WORKING_DIR,
llm_model_func=llm_model_func, llm_model_func=llm_model_func,
@ -170,7 +170,7 @@ async def initialize_pg_rag(WORKING_DIR, namespace_prefix):
graph_storage="PGGraphStorage", graph_storage="PGGraphStorage",
vector_storage="PGVectorStorage", vector_storage="PGVectorStorage",
auto_manage_storages_states=False, auto_manage_storages_states=False,
namespace_prefix=namespace_prefix, workspace='dsideal'
) )
await rag.initialize_storages() await rag.initialize_storages()

Loading…
Cancel
Save