severian42 / GraphRAG-Local-UI

GraphRAG using Local LLMs - Features robust API and multiple apps for Indexing/Prompt Tuning/Query/Chat/Visualizing/Etc. This is meant to be the ultimate GraphRAG/KG local LLM app.
MIT License
1.52k stars 175 forks source link

ERROR executing verb "cluster_graph" in create_base_entity_graph #10

Closed Xls1994 closed 2 months ago

Xls1994 commented 2 months ago

When I use the code and meet this error like follows : `datashaper.workflow.workflow ERROR Error executing verb "cluster_graph" in create_base_entity_graph: Columns must be same length as key Traceback (most recent call last): File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/datashaper/workflow/workflow.py", line 410, in _execute_verb result = node.verb.func(**verb_args) File "/Users/yangyunlong/IdeaProjects/GraphRAG-Ollama-UI/graphrag/index/verbs/graph/clustering/cluster_graph.py", line 102, in cluster_graph output_df[[level_to, to]] = pd.DataFrame( File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/pandas/core/frame.py", line 4299, in setitem self._setitem_array(key, value) File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/pandas/core/frame.py", line 4341, in _setitem_array check_key_length(self.columns, key, value) File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/pandas/core/indexers/utils.py", line 390, in check_key_length raise ValueError("Columns must be same length as key") ValueError: Columns must be same length as key

16:26:12,716 graphrag.index.run ERROR error running workflow create_base_entity_graph Traceback (most recent call last): File "/Users/yangyunlong/IdeaProjects/GraphRAG-Ollama-UI/graphrag/index/run.py", line 323, in run_pipeline result = await workflow.run(context, callbacks) File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/datashaper/workflow/workflow.py", line 369, in run timing = await self._execute_verb(node, context, callbacks) File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/datashaper/workflow/workflow.py", line 410, in _execute_verb result = node.verb.func(**verb_args) File "/Users/yangyunlong/IdeaProjects/GraphRAG-Ollama-UI/graphrag/index/verbs/graph/clustering/cluster_graph.py", line 102, in cluster_graph output_df[[level_to, to]] = pd.DataFrame( File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/pandas/core/frame.py", line 4299, in setitem self._setitem_array(key, value) File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/pandas/core/frame.py", line 4341, in _setitem_array check_key_length(self.columns, key, value) File "/Users/yangyunlong/opt/anaconda3/envs/graphrag-ollama/lib/python3.10/site-packages/pandas/core/indexers/utils.py", line 390, in check_key_length raise ValueError("Columns must be same length as key") ValueError: Columns must be same length as key 16:26:12,717 graphrag.index.reporting.file_workflow_callbacks INFO Error running pipeline! details=None`

The details of yaml file like: embeddings: async_mode: threaded llm: api_base: http://localhost:11434/v1 api_key: ${GRAPHRAG_API_KEY} concurrent_requests: 10 model: nomic-embed-text type: openai_embedding

Thanks for any help.

severian42 commented 2 months ago

This most recent update should solve the issues with indexing and creating the needed output files. Give it a try and report back if you still encounter any errors in indexing and then querying.

How to query the generated graph:

-If you are able to run the Indexing with no errors you will end up with the full output files. -Once you have those, you will need to initialize the folder within the Index Management tab. -Once you have initialized (should be 20 items in total) it will make the graph available to query with the LLM