awni commited on
Commit
efbcfe5
·
verified ·
1 Parent(s): 89ae1fa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -0
README.md CHANGED
@@ -15,3 +15,27 @@ configs:
15
  - split: train
16
  path: data/train-*
17
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  - split: train
16
  path: data/train-*
17
  ---
18
+
19
+ Code to create the dataset:
20
+
21
+ ```python
22
+ from datasets import Dataset, DatasetDict
23
+
24
+ from pathlib import Path
25
+ save_dir = Path.home() / ".cache/mlx-lm/calibration_v5.txt"
26
+ if not save_dir.exists():
27
+ from urllib import request
28
+
29
+ save_dir.parent.mkdir(parents=True, exist_ok=True)
30
+ url = "https://gist.githubusercontent.com/tristandruyen/9e207a95c7d75ddf37525d353e00659c/raw/571fda718462de863e5a0171078c175420c7649a/calibration_data_v5_rc.txt"
31
+ request.urlretrieve(url, save_dir)
32
+ with open(save_dir) as fid:
33
+ texts = fid.read()
34
+
35
+ def gen():
36
+ yield {"text": texts}
37
+ ds = Dataset.from_generator(gen)
38
+
39
+ ds = DatasetDict({"train": ds})
40
+ ds.push_to_hub("mlx-community/mlx_lm_calibration_v5")
41
+ ```