---
title: 数据准备
description: "准备知识库数据，用户可根据脚本选择数据切分粒度及知识库大小。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengrag/bestpractice/kunpengrag_21_0071.html
sourcePath: /source/zh/kunpengrag/bestpractice/kunpengrag_21_0071.html
indexId: 4d9e23e78f6106badd90ca9d07d796dc0eb5ed41efea58feb6e64ed3b004d01c58
---
# 数据准备

准备知识库数据，用户可根据脚本选择数据切分粒度及知识库大小。

1. 进入KunpengRAG仓库的“test-utils/performance-test”的“data-preparation”目录。

```
git clone --branch v2.0.0 https://gitee.com/kunpeng_compute/KunpengRAG.git
cd KunpengRAG/test-utils/performance-test/data-preparation
```


2. 下载中文语料库(https://huggingface.co/datasets/yuhuanstudio/wikipedia-pretrain-zh/tree/main)（Json文件）。
3. 使用Python运行“KunpengRAG/test-utils/performance-test/data_preparation/cute_file.py”脚本，运行前用户需要自行配置以下参数。

```
input_file = "wiki_pretrain_part1.json"         # 输入的 .json 文件路径（注意是普通 JSON 数组）
output_prefix = "output_chunk_"                 # 输出文件前缀
chunk_size = 1000                               # 每个文件最多保存多少条 text
output_dir = "your_store_path"                  # 输出文件夹路径
max_chunks = 100                                # 最多生成多少个文件（防止无限生成）
```


  完成中文语料库数据准备。
