This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Monkey patch the graphrag package to support local models deployed via Ollama. Only tested for graphrag version 0.3.2. | |
| # See https://chishengliu.com/posts/graphrag-local-ollama/ for details. | |
| # | |
| # Usage: | |
| # * How to patch the `graphrag.index` CLI: | |
| # * Save https://github.com/microsoft/graphrag/blob/v0.3.2/graphrag/index/__main__.py as "index.py" | |
| # * Replace line 8 with: | |
| # ```python | |
| # from graphrag.index.cli import index_cli | |
| # from graphrag_monkey_patch import patch_graphrag |