huseinzol05 commited on
Commit
6957d8f
·
1 Parent(s): 8afc850

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +40 -0
README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ms
4
+ ---
5
+
6
+ # Mosaic format for filtered starcoder dataset to train Malaysian LLM
7
+
8
+ This repository is to store dataset shards using mosaic format.
9
+
10
+ 1. prepared at https://github.com/malaysia-ai/dedup-text-dataset/blob/main/pretrain-llm/combine-starcoder.ipynb
11
+ 2. using tokenizer https://huggingface.co/malaysia-ai/bpe-tokenizer
12
+ 3. 4096 context length.
13
+
14
+ ## how-to
15
+
16
+ 1. git clone,
17
+
18
+ ```bash
19
+ git lfs clone https://huggingface.co/datasets/malaysia-ai/mosaic-starcoder-filtered
20
+ ```
21
+
22
+ 2. load it,
23
+
24
+ ```python
25
+ from streaming import LocalDataset
26
+ import numpy as np
27
+ from streaming.base.format.mds.encodings import Encoding, _encodings
28
+
29
+ class UInt16(Encoding):
30
+ def encode(self, obj) -> bytes:
31
+ return obj.tobytes()
32
+
33
+ def decode(self, data: bytes):
34
+ return np.frombuffer(data, np.uint16)
35
+
36
+ _encodings['uint16'] = UInt16
37
+
38
+ dataset = LocalDataset('mosaic-starcoder-filtered')
39
+ len(dataset)
40
+ ```