karthik-codex / Autogen_GraphRAG_Ollama

Microsoft's GraphRAG + AutoGen + Ollama + Chainlit = Fully Local & Free Multi-Agent RAG Superbot
400 stars 78 forks source link

Error creating knowledge graph , Columns lenght mismatch #20

Open MyraBaba opened 3 weeks ago

MyraBaba commented 3 weeks ago

Hi,

I translate pdf to markdown with utils you provide and run.:

python -m graphrag.index --root .

got error in log:

l\" not found, try pulling it first', 'type': 'api_error', 'param': None, 'code': None}}\n", "source": "Error code: 404 - {'error': {'message': 'model \"mistral\" not found, try pulling it first', 'type': 'api_error', 'param': None, 'code': None}}", "details": {"doc_index": 0, "text": "8.5B | 7-3422179704 | |\n|---------------------------------|----------|----------------|--------|----------------|--------------|\n| KHIT MASHINERI, OOO | tion Russian Federa | Moscow | 5082 | 8.4B | 7-4956698839 |\n| VPT-NEFTEMASH, OOO | tion Russian Federa | Vladivostok | 5082 | 8.1B | 7-4956626223 |\n| TEKHMASHYUNIT, OOO | tion Russian Federa | Moscow | 5082 | 7.6B | |\n| RM-TEREKS, OOO | tion Russian Federa | Ufa | 5082 | 6.8B | |\n| NTTS ENERGOAVTOMATIZATSIYA, OOO | tion Russian Federa | Moscow | 5082 | 6.1B | 7-4992313085 |\n| TD KHAILON-RUS, OOO | tion Russian Federa | Moscow | 5082 | 5.3B | |\n| MISS, OOO | tion Russian Federa | Vladivostok | 5082 | 5.4B"}} {"type": "error", "data": "Error executing verb \"cluster_graph\" in create_base_entity_graph: Columns must be same length as key", "stack": "Traceback (most recent call last):\n File \"/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/datashaper/workflow/workflow.py\", line 410, in _execute_verb\n result = node.verb.func(**verb_args)\n File \"/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/graphrag/index/verbs/graph/clustering/cluster_graph.py\", line 102, in cluster_graph\n output_df[[level_to, to]] = pd.DataFrame(\n File \"/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/pandas/core/frame.py\", line 4299, in setitem\n self._setitem_array(key, value)\n File \"/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/pandas/core/frame.py\", line 4341, in _setitem_array\n check_key_length(self.columns, key, value)\n File \"/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/pandas/core/indexers/utils.py\", line 390, in check_key_length\n raise ValueError(\"Columns must be same length as key\")\nValueError: Columns must be same length as key\n", "source": "Columns must be same length as key", "details": null}

how we can handle this

karthik-codex commented 1 week ago

Hi,

I translate pdf to markdown with utils you provide and run.:

python -m graphrag.index --root .

got error in log:

l" not found, try pulling it first', 'type': 'api_error', 'param': None, 'code': None}}\n", "source": "Error code: 404 - {'error': {'message': 'model "mistral" not found, try pulling it first', 'type': 'api_error', 'param': None, 'code': None}}", "details": {"doc_index": 0, "text": "8.5B | 7-3422179704 | |\n|---------------------------------|----------|----------------|--------|----------------|--------------|\n| KHIT MASHINERI, OOO | tion Russian Federa | Moscow | 5082 | 8.4B | 7-4956698839 |\n| VPT-NEFTEMASH, OOO | tion Russian Federa | Vladivostok | 5082 | 8.1B | 7-4956626223 |\n| TEKHMASHYUNIT, OOO | tion Russian Federa | Moscow | 5082 | 7.6B | |\n| RM-TEREKS, OOO | tion Russian Federa | Ufa | 5082 | 6.8B | |\n| NTTS ENERGOAVTOMATIZATSIYA, OOO | tion Russian Federa | Moscow | 5082 | 6.1B | 7-4992313085 |\n| TD KHAILON-RUS, OOO | tion Russian Federa | Moscow | 5082 | 5.3B | |\n| MISS, OOO | tion Russian Federa | Vladivostok | 5082 | 5.4B"}} {"type": "error", "data": "Error executing verb "cluster_graph" in create_base_entity_graph: Columns must be same length as key", "stack": "Traceback (most recent call last):\n File "/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/datashaper/workflow/workflow.py", line 410, in _execute_verb\n result = node.verb.func(verb_args)\n File "/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/graphrag/index/verbs/graph/clustering/cluster_graph.py", line 102, in cluster_graph\n output_df[[level_to, to]] = pd.DataFrame(\n File "/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/pandas/core/frame.py", line 4299, in setitem**\n self._setitem_array(key, value)\n File "/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/pandas/core/frame.py", line 4341, in _setitem_array\n check_key_length(self.columns, key, value)\n File "/home/redel/Projects/Autogen_GraphRAG_Ollama/venvAUTOGen/lib/python3.10/site-packages/pandas/core/indexers/utils.py", line 390, in check_key_length\n raise ValueError("Columns must be same length as key")\nValueError: Columns must be same length as key\n", "source": "Columns must be same length as key", "details": null}

how we can handle this

Did you replace the two embedding python files in the graphrag library with the ones provided in the repo?

zjhong commented 5 days ago
encoding_model: cl100k_base
skip_workflows: []
llm:
  api_key: ${GRAPHRAG_API_KEY}
  type: openai_chat # or azure_openai_chat
  model: llama3:latest

That same problem happened to me, but I found a solution!