infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
17.48k stars 1.78k forks source link

[Bug]: Knowledge base error when I use the Knowledge graph methord #2452

Open kknd222 opened 4 days ago

kknd222 commented 4 days ago

Is there an existing issue for the same bug?

Branch name

0.11.0

Commit ID

none

Other environment information

No response

Actual behavior

An error occured when I use the Knowledge graph methrod in version 0.11.0:

Task has been received. Start to parse. Finish parsing. Extracting entities. Knowledge graph extraction error:'NoneType' object is not subscriptable Knowledge graph extraction error:'NoneType' object is not subscriptable 1/1, elapsed: 66.27512523718178s, used tokens: 3887 1/1, elapsed: 90.88857838138938s, used tokens: 3861

The error logs was found from console of ragflow-server:

[INFO] [2024-09-15 07:42:43,610] [_internal._log] [line:96]: 192.168.224.7 - - [15/Sep/2024 07:42:43] "GET /v1/document/list?kb_id=5108961c733511ef82ce0242c0a8e007&page=1&page_size=10 HTTP/1.1" 200 - [ERROR] [2024-09-15 07:42:47,859] [graph_extractor.call] [line:135]: error extracting graph Traceback (most recent call last): File "/ragflow/graphrag/graph_extractor.py", line 128, in call result, token_count = self._process_document(text, prompt_variables) File "/ragflow/graphrag/graph_extractor.py", line 166, in _process_document response = self._llm.chat(text, [{"role": "user", "content": "Output:"}], gen_conf) File "/ragflow/api/db/services/llm_service.py", line 250, in chat txt, used_tokens = self.mdl.chat(system, history, gen_conf) File "/ragflow/rag/llm/chat_model.py", line 45, in chat ans = response.choices[0].message.content.strip() TypeError: 'NoneType' object is not subscriptable [ERROR] [2024-09-15 07:42:48,000] [graph_extractor.call] [line:135]: error extracting graph Traceback (most recent call last): File "/ragflow/graphrag/graph_extractor.py", line 128, in call result, token_count = self._process_document(text, prompt_variables) File "/ragflow/graphrag/graph_extractor.py", line 166, in _process_document response = self._llm.chat(text, [{"role": "user", "content": "Output:"}], gen_conf) File "/ragflow/api/db/services/llm_service.py", line 250, in chat txt, used_tokens = self.mdl.chat(system, history, gen_conf) File "/ragflow/rag/llm/chat_model.py", line 45, in chat ans = response.choices[0].message.content.strip() TypeError: 'NoneType' object is not subscriptable

Expected behavior

No response

Steps to reproduce

upload the document and process with Knowledge graph methord

Additional information

No response

KevinHuSh commented 1 day ago

It seems the response from LLM has error.

KevinHuSh commented 1 day ago

What's LLM you're using?

kknd222 commented 1 day ago

What's LLM you're using?

new-api with deepseek and glm4 api