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

46 lines
984 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

![](../resources/logo.jpeg)
[English](README.md) | [中文](README_zh.md)
## RAG功能
CodeGeeX4支持RAG检索增强并兼容LlamaIndex框架实现项目级检索问答。
## 使用教程
### 1. 安装依赖项
```bash
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. 生成向量数据
```bash
python vectorize.py --workspace . --output_path vectors
>>> 文件向量化完成,已保存至vectors
```
### 4. 运行问答脚本
```bash
python chat.py --vector_path vectors
>>> Running on local URL: http://127.0.0.1:8080
```
## Demo
![](resources/demo_zh.png)