--- language: - ms --- # Mosaic format for filtered starcoder dataset to train Malaysian LLM This repository is to store dataset shards using mosaic format. 1. prepared at https://github.com/malaysia-ai/dedup-text-dataset/blob/main/pretrain-llm/combine-starcoder.ipynb 2. using tokenizer https://huggingface.co/malaysia-ai/bpe-tokenizer 3. 4096 context length. ## how-to 1. git clone, ```bash git lfs clone https://huggingface.co/datasets/malaysia-ai/mosaic-starcoder-filtered ``` 2. load it, ```python from streaming import LocalDataset import numpy as np from streaming.base.format.mds.encodings import Encoding, _encodings class UInt16(Encoding): def encode(self, obj) -> bytes: return obj.tobytes() def decode(self, data: bytes): return np.frombuffer(data, np.uint16) _encodings['uint16'] = UInt16 dataset = LocalDataset('mosaic-starcoder-filtered') len(dataset) ```