From e053223ef0bd03680724a74b6db25d0456946413 Mon Sep 17 00:00:00 2001 From: Samuel Chan Date: Sat, 4 Jan 2025 18:34:35 +0800 Subject: [PATCH] Fix the lint issue --- examples/lightrag_zhipu_postgres_demo.py | 10 ------- lightrag/kg/postgres_impl.py | 2 +- lightrag/kg/postgres_impl_test.py | 9 ++---- requirements.txt | 35 +++++++++++++++--------- 4 files changed, 26 insertions(+), 30 deletions(-) diff --git a/examples/lightrag_zhipu_postgres_demo.py b/examples/lightrag_zhipu_postgres_demo.py index 9187e2a2..1462fdd2 100644 --- a/examples/lightrag_zhipu_postgres_demo.py +++ b/examples/lightrag_zhipu_postgres_demo.py @@ -104,13 +104,3 @@ async def main(): if __name__ == "__main__": asyncio.run(main()) - - -async def print_stream(stream): - async for chunk in stream: - print(chunk, end="", flush=True) - - - - - diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index 8d60f471..dc027113 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -1137,4 +1137,4 @@ SQL_TEMPLATES = { FROM LIGHTRAG_DOC_CHUNKS where workspace=$1) WHERE distance>$2 ORDER BY distance DESC LIMIT $3 """ -} \ No newline at end of file +} diff --git a/lightrag/kg/postgres_impl_test.py b/lightrag/kg/postgres_impl_test.py index 66cdfcc7..d98849c1 100644 --- a/lightrag/kg/postgres_impl_test.py +++ b/lightrag/kg/postgres_impl_test.py @@ -20,10 +20,9 @@ if sys.platform.startswith("win"): async def get_pool(): return await asyncpg.create_pool( f"postgres://{USER}:{PASSWORD}@{HOST}:{PORT}/{DB}", - min_size=10, # 连接池初始化时默认的最小连接数, 默认为1 0 - max_size=10, # 连接池的最大连接数, 默认为 10 - max_queries=5000, # 每个链接最大查询数量, 超过了就换新的连接, 默认 5000 - # 最大不活跃时间, 默认 300.0, 超过这个时间的连接就会被关闭, 传入 0 的话则永不关闭 + min_size=10, + max_size=10, + max_queries=5000, max_inactive_connection_lifetime=300.0 ) @@ -118,5 +117,3 @@ async def main(): if __name__ == '__main__': asyncio.run(query_with_age()) - - diff --git a/requirements.txt b/requirements.txt index abcc7f97..82252628 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,29 +1,38 @@ accelerate -aioboto3 -aiohttp +aioboto3~=13.3.0 +aiohttp~=3.11.11 # database packages graspologic gremlinpython hnswlib nano-vectordb -neo4j -networkx -ollama -openai +neo4j~=5.27.0 +networkx~=3.2.1 +ollama~=0.4.4 +openai~=1.58.1 oracledb -psycopg[binary,pool] +psycopg[binary,pool]~=3.2.3 pymilvus pymongo pymysql -pyvis +pyvis~=0.3.2 # lmdeploy[all] -sqlalchemy -tenacity +sqlalchemy~=2.0.36 +tenacity~=9.0.0 # LLM packages -tiktoken -torch -transformers +tiktoken~=0.8.0 +torch~=2.5.1+cu121 +transformers~=4.47.1 xxhash + +numpy~=2.2.0 +aiofiles~=24.1.0 +pydantic~=2.10.4 +python-dotenv~=1.0.1 +psycopg-pool~=3.2.4 +tqdm~=4.67.1 +asyncpg~=0.30.0 +setuptools~=70.0.0 \ No newline at end of file