huseinzol05 commited on
Commit
58ca69c
1 Parent(s): 6321cac

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 combine dataset to finetune TinyLlama models
7
+
8
+ This repository is to store dataset shards using mosaic format.
9
+
10
+ 1. https://github.com/malaysia-ai/dedup-text-dataset/blob/main/tinyllama/combine-dataset.ipynb
11
+ 2. using tokenizer https://huggingface.co/TinyLlama/TinyLlama-1.1B-intermediate-step-955k-token-2T
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-tinyllama
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-tinyllama')
39
+ len(dataset)
40
+ ```