diff --git a/README.md b/README.md index d8c6708..33c0c9e 100644 --- a/README.md +++ b/README.md @@ -104,12 +104,17 @@ Colab for fine-tuning RWKV-4 Pile models: https://colab.research.google.com/gith ``` python tools/preprocess_data.py --input ./my_data.jsonl --output-prefix ./data/my_data --vocab ./20B_tokenizer.json --dataset-impl mmap --tokenizer-type HFTokenizer --append-eod ``` -The jsonl format sample: +The jsonl format sample (one line for each document): ``` {"meta": {"ID": 101}, "text": "This is the first document."} {"meta": {"ID": 102}, "text": "Hello\nWorld"} {"meta": {"ID": 103}, "text": "1+1=2\n1+2=3\n2+2=4"} ``` +generated by code like this: +``` +ss = json.dumps({"meta": meta, "text": text}, ensure_ascii=False) +out.write(ss + "\n") +``` ## How it works