P1uviophile / simple_RAG_with_LLMs_API

基于大语言模型API(本地或商用API)的外挂知识库问答系统(附neo4j实现知识图谱)
7 stars 2 forks source link

你好,运行生成知识图谱.py时出错, #1

Open LittleMonster104 opened 2 months ago

LittleMonster104 commented 2 months ago

你好,我在运行生成知识图谱.py时出错,错误如下:请问如何解决?

生成知识图谱.py Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/init.py", line 806, in acquire cx = self._free_list.popleft() ^^^^^^^^^^^^^^^^^^^^^^^^^ IndexError: pop from an empty deque

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/errors.py", line 54, in split_code parts = code.split(".") ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'split'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/jiazhu/Downloads/simple_RAG_with_LLMs_API-main/neo4j/生成知识图谱.py", line 6, in graph = Graph("http://localhost:7474/browser/", auth=('neo4j', 'neo4j')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/database.py", line 288, in init self.service = GraphService(profile, settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/database.py", line 119, in init self._connector = Connector(profile, connector_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/init.py", line 960, in init self._add_pools(*self._initial_routers) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/init.py", line 982, in _addpools pool = ConnectionPool.open( ^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/init.py", line 649, in open seeds = [pool.acquire() for in range(init_size or cls.default_init_size)] ^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/init.py", line 813, in acquire cx = self._connect() ^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/init.py", line 764, in _connect cx = Connection.open(self.profile, user_agent=self.user_agent, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/init.py", line 178, in open return HTTP.open(profile, user_agent=user_agent, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/http.py", line 63, in open http._hello(user_agent or http_user_agent()) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/http.py", line 162, in hello rs.audit() File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/client/http.py", line 479, in audit failure = Neo4jError.hydrate(self.errors().pop(0)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/errors.py", line 46, in hydrate return cls(message, code) ^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/errors.py", line 64, in new classification, , _ = cls.split_code(code) ^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py2neo/errors.py", line 56, in split_code raise ValueError(code) ValueError: None

P1uviophile commented 2 months ago

报错说你没连上数据库 所以你开neo4j了吗?开了之后还要把用户名和密码改成你自己的 其实我更推荐你自己重写关于neo4j的相关代码,因为这个项目里关于它的代码没有通用性 想直接套用的话得完全符合document里面的知识图谱表格.csv 而且实际上neo4j的相关代码只提供了推荐知识点这个没卵用的功能 想拓展还是得你自己写orz 综上所述, 你还不如直接问大模型有什么相关的知识点