Closed Minxiangliu closed 1 month ago
这个问题出现在ollama模型在解码时受到上下文长度的限制,导致的返回结果超时的问题。 具体体现在: llm: api_key: ${GRAPHRAG_API_KEY} type: openai_chat # or azure_openai_chat model: qwen2-7b-instruct-q5_k_m model_supports_json: true # recommended if this is available for your model. max_tokens: 4000
即便你设置了一个max_tokens,但是你ollama默认的模型的上下文容量达不到这个长度, 因为graph-rag的agent的prompt写的实在有点长。解决方案就是从Modelfile开始,手动构造一个model,并且指定一个比较长的上下文长度。视频中有提到过,你可以尝试一下。希望可以帮助到你。
感謝你的教程,在建立knowledge graph時候我知道他會花費很多時間,但是我發現他會在執行過程中發生瓶頸,電腦的CPU和GPU幾乎沒有甚麼在運作,請問這是正常的嗎? 有甚麼方法可以改善效率呢?
前提致謝!
圖片中的執行時間是我已經中斷後重新執行
settings.yaml