- Go to https://github.com/settings/tokens and create new token by clicking
Generate New Tokenbutton. Give read access to public repositories. - Copy the access token and set the env variable via
export GH_ACCESS_TOKEN=<copied access token>. cd dataset_creationand Runpython clone_hf_repos.py- The data in
hf_public_reposfolder in current repo should look like below:
accelerate candle datasets diffusers notebooks pytorch-image-models tokenizers trl
alignment-handbook chat-ui deep-rl-class diffusion-models-class peft text-generation-inference transformers
- Download nltk punkt
import nltk
nltk.download('punkt')- Run Data Pipeline on a machine with 16 CPUs:
python pipeline.py
- Collate and push to hub:
python prepare_hf_dataset.py
- Create tokenizer:
cd ../tokenizer_creation
python create_tokenizer.py
- Training the model from scratch using DeepSpeed on 8 A100 GPUs
- Look at the loss plots
- No evaluations were carried out because a 7B more training from scratch require atleast a ~1 Trillion tokens and have only trained on ~110 Million tokens which is 10^4 order less.
Note:
- if you are getting dataset related issue
Loading a streaming dataset cached in a LocalFileSystem is not supported yet., runpip install -U datasets
- Go to SFT subfloder and run the below command
cd Module5/sft
bash run_sft.sh
- Go to DPO subfloder and run the below command after the SFt finetuning is completed.
cd Module5/dpo
bash run_dpo.sh
- Go to PPO subfloder and open the notebook and run all the cells.