From 31ffbde24dd2e30c3d06331ac4b47d966fc2a191 Mon Sep 17 00:00:00 2001 From: hiyouga Date: Tue, 2 Apr 2024 20:41:49 +0800 Subject: [PATCH] update examples --- examples/README.md | 4 ++-- examples/extras/fsdp_qlora/README.md | 5 ----- examples/extras/fsdp_qlora/sft.sh | 4 ++++ examples/lora_single_gpu/README.md | 9 --------- examples/merge_lora/README.md | 13 ------------- 5 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 examples/extras/fsdp_qlora/README.md delete mode 100644 examples/lora_single_gpu/README.md delete mode 100644 examples/merge_lora/README.md diff --git a/examples/README.md b/examples/README.md index 71c4b742..6aeaaab1 100644 --- a/examples/README.md +++ b/examples/README.md @@ -23,8 +23,8 @@ examples/ │ ├── single_node.sh │ └── multi_node.sh ├── merge_lora/ -│ ├── merge.sh -│ └── quantize.sh +│ ├── merge.sh: Merge LoRA weights +│ └── quantize.sh: Quantize with AutoGPTQ ├── inference/ │ ├── cli_demo.sh │ ├── api_demo.sh diff --git a/examples/extras/fsdp_qlora/README.md b/examples/extras/fsdp_qlora/README.md deleted file mode 100644 index 39cd2dbe..00000000 --- a/examples/extras/fsdp_qlora/README.md +++ /dev/null @@ -1,5 +0,0 @@ -```bash -pip install "transformers>=4.39.1" -pip install "accelerate>=0.28.0" -pip install "bitsandbytes>=0.43.0" -``` diff --git a/examples/extras/fsdp_qlora/sft.sh b/examples/extras/fsdp_qlora/sft.sh index 0fce3ecc..8ffb5f2e 100644 --- a/examples/extras/fsdp_qlora/sft.sh +++ b/examples/extras/fsdp_qlora/sft.sh @@ -1,5 +1,9 @@ #!/bin/bash +pip install "transformers>=4.39.1" +pip install "accelerate>=0.28.0" +pip install "bitsandbytes>=0.43.0" + CUDA_VISIBLE_DEVICES=0,1 accelerate launch \ --config_file ../accelerate/fsdp_config.yaml \ ../../src/train_bash.py \ diff --git a/examples/lora_single_gpu/README.md b/examples/lora_single_gpu/README.md deleted file mode 100644 index 151d0784..00000000 --- a/examples/lora_single_gpu/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Usage: - -- `pretrain.sh`: do pre-train (optional) -- `sft.sh`: do supervised fine-tuning -- `reward.sh`: do reward modeling (must after sft.sh) -- `ppo.sh`: do PPO training (must after sft.sh and reward.sh) -- `dpo.sh`: do DPO training (must after sft.sh) -- `orpo.sh`: do ORPO training -- `predict.sh`: do predict (must after sft.sh and dpo.sh) diff --git a/examples/merge_lora/README.md b/examples/merge_lora/README.md deleted file mode 100644 index a095f288..00000000 --- a/examples/merge_lora/README.md +++ /dev/null @@ -1,13 +0,0 @@ -> [!WARNING] -> Merging LoRA weights into a quantized model is not supported. - -> [!TIP] -> Use `--model_name_or_path path_to_model` solely to use the exported model or model fine-tuned in full/freeze mode. -> -> Use `CUDA_VISIBLE_DEVICES=0`, `--export_quantization_bit 4` and `--export_quantization_dataset data/c4_demo.json` to quantize the model with AutoGPTQ after merging the LoRA weights. - - -Usage: - -- `merge.sh`: merge the lora weights -- `quantize.sh`: quantize the model with AutoGPTQ (must after merge.sh, optional)