GraphRAG开发指南

目录

Development Guide  开发指南

Requirements  要求

Getting Started  入门

Install Dependencies  安装依赖项

Execute the Indexing Engine执行索引引擎

Executing Queries  执行查询

Azurite  蓝铜矿

Lifecycle Scripts  生命周期脚本

Troubleshooting  故障排除

"RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config" when running poetry install运行 poetry install 时出现“RuntimeError: llvm-config 执行失败,请将 LLVM_CONFIG 指向 llvm-config 的路径”

"numba/_pymodule.h:6:10: fatal error: Python.h: No such file or directory" when running poetry install运行 poetry install 时出现“numba/_pymodule.h:6:10: 致命错误:Python.h: 没有此文件或目录”

LLM call constantly exceeds TPM, RPM or time limitsLLM 通话不断超出 TPM、RPM 或时间限制


Development Guide  开发指南

Requirements  要求

Name  姓名Installation  安装Purpose  目的
Python 3.10-3.12Download  下载The library is Python-based.
该库基于 Python。
Poetry  诗Instructions  指示Poetry is used for package management and virtualenv management in Python codebases
Poetry 用于 Python 代码库中的包管理和虚拟环境管理

Getting Started  入门

Install Dependencies  安装依赖项

# Install Python dependencies.
poetry install

Execute the Indexing Engine
执行索引引擎

poetry run poe index <...args>

Executing Queries  执行查询

poetry run poe query <...args>

Azurite  蓝铜矿

Some unit and smoke tests use Azurite to emulate Azure resources. This can be started by running:
一些单元测试和冒烟测试使用 Azurite 来模拟 Azure 资源。可以通过运行以下命令来启动:

./scripts/start-azurite.sh

or by simply running azurite in the terminal if already installed globally. See the Azurite documentation for more information about how to install and use Azurite.
或者,如果已全局安装,只需在终端中运行 azurite 即可。有关如何安装和使用 Azurite 的更多信息,请参阅 Azurite 文档 

Lifecycle Scripts  生命周期脚本

Our Python package utilizes Poetry to manage dependencies and poethepoet to manage build scripts.
我们的 Python 包利用 Poetry 来管理依赖项,利用 poethepoet 来管理构建脚本。

Available scripts are:  可用的脚本有:

  • poetry run poe index - Run the Indexing CLI
    poetry run poe index - 运行索引 CLI
  • poetry run poe query - Run the Query CLI
    poetry run poe query - 运行查询 CLI
  • poetry build - This invokes poetry build, which will build a wheel file and other distributable artifacts.
    poetry build ——这将调用 poetry build ,它将构建一个轮子文件和其他可分发的工件。
  • poetry run poe test - This will execute all tests.
    poetry run poe test - 这将执行所有测试。
  • poetry run poe test_unit - This will execute unit tests.
    poetry run poe test_unit - 这将执行单元测试。
  • poetry run poe test_integration - This will execute integration tests.
    poetry run poe test_integration - 这将执行集成测试。
  • poetry run poe test_smoke - This will execute smoke tests.
    poetry run poe test_smoke - 这将执行烟雾测试。
  • poetry run poe test_verbs - This will execute tests of the basic workflows.
    poetry run poe test_verbs - 这将执行基本工作流程的测试。
  • poetry run poe check - This will perform a suite of static checks across the package, including:
    poetry run poe check - 这将在整个包中执行一系列静态检查,包括:
  • formatting  格式化
  • documentation formatting
    文档格式
  • linting
  • security patterns  安全模式
  • type-checking  类型检查
  • poetry run poe fix - This will apply any available auto-fixes to the package. Usually this is just formatting fixes.
    poetry run poe fix - 这会将任何可用的自动修复应用于包。通常只是格式修复。
  • poetry run poe fix_unsafe - This will apply any available auto-fixes to the package, including those that may be unsafe.
    poetry run poe fix_unsafe - 这将对包应用任何可用的自动修复,包括那些可能不安全的修复。
  • poetry run poe format - Explicitly run the formatter across the package.
    poetry run poe format - 在整个包中明确运行格式化程序。

Troubleshooting  故障排除

"RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config" when running poetry install
运行 poetry install 时出现“RuntimeError: llvm-config 执行失败,请将 LLVM_CONFIG 指向 llvm-config 的路径”

Make sure llvm-9 and llvm-9-dev are installed:
确保已安装 llvm-9 和 llvm-9-dev:

sudo apt-get install llvm-9 llvm-9-dev

and then in your bashrc, add
然后在你的 bashrc 中添加

export LLVM_CONFIG=/usr/bin/llvm-config-9

"numba/_pymodule.h:6:10: fatal error: Python.h: No such file or directory" when running poetry install
运行 poetry install 时出现“numba/_pymodule.h:6:10: 致命错误:Python.h: 没有此文件或目录”

Make sure you have python3.10-dev installed or more generally python<version>-dev
确保已安装 python3.10-dev 或更常见的 python<version>-dev

sudo apt-get install python3.10-dev

LLM call constantly exceeds TPM, RPM or time limits
LLM 通话不断超出 TPM、RPM 或时间限制

GRAPHRAG_LLM_THREAD_COUNT and GRAPHRAG_EMBEDDING_THREAD_COUNT are both set to 50 by default. You can modify these values to reduce concurrency. Please refer to the Configuration Documents
GRAPHRAG_LLM_THREAD_COUNT 和 GRAPHRAG_EMBEDDING_THREAD_COUNT 默认均设置为 50。您可以修改这些值以降低并发度。请参阅配置文档

引用原文:

Development Guide - GraphRAG

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值