Data Process
April 5, 2023 ยท View on GitHub
Prepare chatbot data contains 52K instruction-following data we used for fine-tuning the Alpaca model.
bash prepare_llama_training_data.sh
parameter:
DATAinit dataset dir, download the alpaca data alpaca_data.json.SPMsentencepiece project spm dir: "sentencepiece/build/src/spm_encode".MODELLLaMA tokenizer model "tokenizer.model".
Model Process
Build Model Checkpoint
Process the LLaMA model based on your equipment (GPU devices).
-
single model checkpoint:
python alpaca_lora/scripts/utils/process_llama_ckpt.py --llama-model-dir $llama_dir --llama-model-file $llama_file -
Megatron-LM model checkpoint:
python alpaca_lora/scripts/utils/process_llama_megatron_ckpt.py --llama-model-dir $llama_dir --llama-model-file $llama_file --parallel-size 2parameter:
--parallel-sizeThe number of GPUs to use.
after that, we can get new checkpoint file model.pt.
Merge Model Checkpoint
We can merge multiple Megatron-LM Checkpoints into a single Checkpoint to support the hub or web interface mode.
python merge_llama_megatron_ckpt.py