# Fine-tune
pip install -r requirements.txt
# LLamaFactory:
finetune/fine_tune_cllama.sh

finetune/fine_tune_llama2.sh

finetune/fine_tune_mistral.sh

finetune/generate_prediction_cllama.sh

finetune/generate_prediction_llama2.sh

finetune/generate_prediction_mistral.sh

Training with LLamaFactory requires specifying the dataset in dataset_info.json

dataset_info.json should be inside the folder of --dataset_dir, which is also where the training file should be

The training script is modified that the first xxx(specified by --train_size) entries of the training file are for training while the rest are for validation




# FastChat:

Note on flash attention:
Flash attention 2.3.0 supports transformers==4.33.1 or below.
Mistral requires transformers==4.35.0 to run, but Mistral has flash-attn version(see download_model.py for the flag to use to download this version)
For codellama and llama2, to use flash-attn(which is train_mem.py in FastChat), transformers need to be 4.33.1 or below

fine-tune commands are in
agent/finetune/finetune.sh
If fine-tuning Mistral with deepspeed, --shuffle need to be set to true to avoid zero loss.
