huseinzol05 commited on
Commit
e8f23cc
·
1 Parent(s): b484bef

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +39 -0
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ms
4
+ ---
5
+
6
+ # Mosaic format for combine all 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-all.ipynb
11
+ 2. using tokenizer https://huggingface.co/malaysia-ai/bpe-tokenizer
12
+
13
+ ## how-to
14
+
15
+ 1. git clone,
16
+
17
+ ```bash
18
+ git lfs clone https://huggingface.co/datasets/malaysia-ai/mosaic-combine-all
19
+ ```
20
+
21
+ 2. load it,
22
+
23
+ ```python
24
+ from streaming import LocalDataset
25
+ import numpy as np
26
+ from streaming.base.format.mds.encodings import Encoding, _encodings
27
+
28
+ class UInt16(Encoding):
29
+ def encode(self, obj) -> bytes:
30
+ return obj.tobytes()
31
+
32
+ def decode(self, data: bytes):
33
+ return np.frombuffer(data, np.uint16)
34
+
35
+ _encodings['uint16'] = UInt16
36
+
37
+ dataset = LocalDataset('mosaic-combine-all')
38
+ len(dataset)
39
+ ```