CodeGeeX4/llamaindex_demo/README_zh.md
2024-07-05 09:33:53 +08:00

984 B
Raw Permalink Blame History

English | 中文

RAG功能

CodeGeeX4支持RAG检索增强并兼容LlamaIndex框架实现项目级检索问答。

使用教程

1. 安装依赖项

cd llamaindex_demo
pip install -r requirements.txt

此项目使用到tree-sitter-language其与python3.10兼容的有问题因此请使用python3.8或python3.9运行该项目。

2. 配置Embedding API Key

本项目使用智谱开放平台的Embedding API实现向量化功能请先注册并获取API Key。

并在models/embedding.py中配置API Key。

详情可参考 https://open.bigmodel.cn/dev/api#text_embedding

3. 生成向量数据

python vectorize.py --workspace . --output_path vectors

>>> 文件向量化完成,已保存至vectors

4. 运行问答脚本

python chat.py --vector_path vectors

>>> Running on local URL:  http://127.0.0.1:8080

Demo