-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# How to build with your own data | ||
1. Prepare your corpus and split it into small jsonl files with the following structure (like Pile, but we only need the `text` key), and put them into a folder named `splits`. | ||
``` | ||
{ | ||
'meta': {'pile_set_name': 'Pile-CC'}, | ||
'text': 'It is done, and submitted. You can play “Survival of the Tastiest” on Android, and on the web. Playing on...' | ||
} | ||
``` | ||
2. Build metadata | ||
```bash | ||
python build_split_meta.py | ||
``` | ||
3. Build shard | ||
```bash | ||
python build_shard.py | ||
``` | ||
4. Build database | ||
```bash | ||
build_db.py | ||
``` | ||
5. Build index. The Faiss parameter is hardcoded now. Choosing an index is like a kind of compute resource and recall tradeoff. See [Faiss wiki](https://github.com/facebookresearch/faiss/wiki/The-index-factory) for more details. | ||
```bash | ||
build_index.py | ||
``` |