From 894505a1af2dd31aa960646496c0f59f388b654b Mon Sep 17 00:00:00 2001 From: Sypherd Date: Tue, 19 Sep 2023 08:00:33 -0600 Subject: [PATCH 1/3] Specify absolute path in configs --- PrepareVicuna.md | 2 +- dataset/README_1_STAGE.md | 2 +- eval_configs/minigpt4_llama2_eval.yaml | 2 +- minigpt4/configs/datasets/cc_sbu/align.yaml | 2 +- minigpt4/configs/datasets/cc_sbu/defaults.yaml | 2 +- minigpt4/configs/datasets/laion/defaults.yaml | 2 +- minigpt4/configs/models/minigpt4_llama2.yaml | 2 +- minigpt4/configs/models/minigpt4_vicuna0.yaml | 2 +- train_configs/minigpt4_llama2_stage2_finetune.yaml | 2 +- train_configs/minigpt4_stage2_finetune.yaml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PrepareVicuna.md b/PrepareVicuna.md index 0585e62f..b18cfd89 100644 --- a/PrepareVicuna.md +++ b/PrepareVicuna.md @@ -28,7 +28,7 @@ pip install git+https://github.com/lm-sys/FastChat.git@v0.1.10 Then, run the following command to create the final working weight ``` -python -m fastchat.model.apply_delta --base /path/to/llama-13bOR7b-hf/ --target /path/to/save/working/vicuna/weight/ --delta /path/to/vicuna-13bOR7b-delta-v0/ +python -m fastchat.model.apply_delta --base /absolute/path/to/llama-13bOR7b-hf/ --target /absolute/path/to/save/working/vicuna/weight/ --delta /absolute/path/to/vicuna-13bOR7b-delta-v0/ ``` Now you are good to go! diff --git a/dataset/README_1_STAGE.md b/dataset/README_1_STAGE.md index 47ffaaef..5c92b925 100644 --- a/dataset/README_1_STAGE.md +++ b/dataset/README_1_STAGE.md @@ -21,7 +21,7 @@ laion_synthetic_filtered_large.json ### setup the dataset folder and move the annotation file to the data storage folder ``` -export MINIGPT4_DATASET=/YOUR/PATH/FOR/LARGE/DATASET/ +export MINIGPT4_DATASET=/YOUR/ABSOLUTE/PATH/FOR/LARGE/DATASET/ mkdir ${MINIGPT4_DATASET}/cc_sbu mkdir ${MINIGPT4_DATASET}/laion mv ccs_synthetic_filtered_large.json ${MINIGPT4_DATASET}/cc_sbu diff --git a/eval_configs/minigpt4_llama2_eval.yaml b/eval_configs/minigpt4_llama2_eval.yaml index eea99d3b..284019c9 100644 --- a/eval_configs/minigpt4_llama2_eval.yaml +++ b/eval_configs/minigpt4_llama2_eval.yaml @@ -5,7 +5,7 @@ model: end_sym: "" low_resource: True prompt_template: '[INST] {} [/INST] ' - ckpt: '/path/to/checkpoint/' + ckpt: '/absolute/path/to/checkpoint/' datasets: diff --git a/minigpt4/configs/datasets/cc_sbu/align.yaml b/minigpt4/configs/datasets/cc_sbu/align.yaml index 57108342..7f343946 100644 --- a/minigpt4/configs/datasets/cc_sbu/align.yaml +++ b/minigpt4/configs/datasets/cc_sbu/align.yaml @@ -2,4 +2,4 @@ datasets: cc_sbu_align: data_type: images build_info: - storage: /path/to/cc_sbu_align/ + storage: /absolute/path/to/cc_sbu_align/ diff --git a/minigpt4/configs/datasets/cc_sbu/defaults.yaml b/minigpt4/configs/datasets/cc_sbu/defaults.yaml index 60390eec..d159ada2 100644 --- a/minigpt4/configs/datasets/cc_sbu/defaults.yaml +++ b/minigpt4/configs/datasets/cc_sbu/defaults.yaml @@ -2,4 +2,4 @@ datasets: cc_sbu: data_type: images build_info: - storage: /path/to/cc_sbu_dataset/{00000..01255}.tar + storage: /absolute/path/to/cc_sbu_dataset/{00000..01255}.tar diff --git a/minigpt4/configs/datasets/laion/defaults.yaml b/minigpt4/configs/datasets/laion/defaults.yaml index 6bad6290..fcf51b36 100644 --- a/minigpt4/configs/datasets/laion/defaults.yaml +++ b/minigpt4/configs/datasets/laion/defaults.yaml @@ -2,4 +2,4 @@ datasets: laion: data_type: images build_info: - storage: /path/to/laion_dataset/{00000..10488}.tar + storage: /absolute/path/to/laion_dataset/{00000..10488}.tar diff --git a/minigpt4/configs/models/minigpt4_llama2.yaml b/minigpt4/configs/models/minigpt4_llama2.yaml index c201bdcc..19115b47 100644 --- a/minigpt4/configs/models/minigpt4_llama2.yaml +++ b/minigpt4/configs/models/minigpt4_llama2.yaml @@ -12,7 +12,7 @@ model: # generation configs prompt: "" - llama_model: "/path/to/llama2/weight" + llama_model: "/absolute/path/to/llama2/weight" preprocess: vis_processor: diff --git a/minigpt4/configs/models/minigpt4_vicuna0.yaml b/minigpt4/configs/models/minigpt4_vicuna0.yaml index 34bd2ed3..e94cee07 100644 --- a/minigpt4/configs/models/minigpt4_vicuna0.yaml +++ b/minigpt4/configs/models/minigpt4_vicuna0.yaml @@ -15,7 +15,7 @@ model: # generation configs prompt: "" - llama_model: "/path/to/vicuna/weight" + llama_model: "/absolute/path/to/vicuna/weight" preprocess: vis_processor: diff --git a/train_configs/minigpt4_llama2_stage2_finetune.yaml b/train_configs/minigpt4_llama2_stage2_finetune.yaml index 9a6ac2d9..99231542 100644 --- a/train_configs/minigpt4_llama2_stage2_finetune.yaml +++ b/train_configs/minigpt4_llama2_stage2_finetune.yaml @@ -6,7 +6,7 @@ model: end_sym: "" prompt_path: "prompts/alignment.txt" prompt_template: '[INST] {} [/INST] ' - ckpt: '/path/to/stage1/checkpoint/' + ckpt: '/absolute/path/to/stage1/checkpoint/' datasets: diff --git a/train_configs/minigpt4_stage2_finetune.yaml b/train_configs/minigpt4_stage2_finetune.yaml index 54cedb46..9046f315 100644 --- a/train_configs/minigpt4_stage2_finetune.yaml +++ b/train_configs/minigpt4_stage2_finetune.yaml @@ -6,7 +6,7 @@ model: end_sym: "###" prompt_path: "prompts/alignment.txt" prompt_template: '###Human: {} ###Assistant: ' - ckpt: '/path/to/stage1/checkpoint/' + ckpt: '/absolute/path/to/stage1/checkpoint/' datasets: From d1566968339d6149954a68f37e0be906a8d7376f Mon Sep 17 00:00:00 2001 From: Sypherd Date: Tue, 19 Sep 2023 08:05:26 -0600 Subject: [PATCH 2/3] Specify absolute path in READMEs --- README.md | 8 ++++---- dataset/README_1_STAGE.md | 4 ++-- dataset/README_2_STAGE.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 02bc5044..f09367ca 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,9 @@ Download the corresponding LLM weights from the following huggingface space via [Downlad](https://huggingface.co/Vision-CAIR/vicuna/tree/main) | [Download](https://huggingface.co/Vision-CAIR/vicuna-7b/tree/main) | [Download](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf/tree/main) -Then, set the path to the vicuna weight in the model config file +Then, set the absolute path to the vicuna weight in the model config file [here](minigpt4/configs/models/minigpt4_vicuna0.yaml#L18) at Line 18 -and/or the path to the llama2 weight in the model config file +and/or the absolute path to the llama2 weight in the model config file [here](minigpt4/configs/models/minigpt4_llama2.yaml#L15) at Line 15. **3. Prepare the pretrained MiniGPT-4 checkpoint** @@ -78,7 +78,7 @@ Download the pretrained checkpoints according to the Vicuna model you prepare. [Downlad](https://drive.google.com/file/d/1a4zLvaiDBr-36pasffmgpvH5P7CKmpze/view?usp=share_link) | [Download](https://drive.google.com/file/d/1RY9jV0dyqLX-o38LrumkKRh6Jtaop58R/view?usp=sharing) | [Download](https://drive.google.com/file/d/11nAPjEok8eAGGEG1N2vXo3kBLCg0WgUk/view?usp=sharing) -Then, set the path to the pretrained checkpoint in the evaluation config file +Then, set the absolute path to the pretrained checkpoint in the evaluation config file in [eval_configs/minigpt4_eval.yaml](eval_configs/minigpt4_eval.yaml#L10) at Line 8 for Vicuna version or [eval_configs/minigpt4_llama2_eval.yaml](eval_configs/minigpt4_llama2_eval.yaml#L10) for LLama2 version. @@ -137,7 +137,7 @@ and convert it to a conversation format to further align MiniGPT-4. To download and prepare our second stage dataset, please check our [second stage dataset preparation instruction](dataset/README_2_STAGE.md). To launch the second stage alignment, -first specify the path to the checkpoint file trained in stage 1 in +first specify the absolute path to the checkpoint file trained in stage 1 in [train_configs/minigpt4_stage1_pretrain.yaml](train_configs/minigpt4_stage2_finetune.yaml). You can also specify the output path there. Then, run the following command. In our experiments, we use 1 A100. diff --git a/dataset/README_1_STAGE.md b/dataset/README_1_STAGE.md index 5c92b925..dfe45165 100644 --- a/dataset/README_1_STAGE.md +++ b/dataset/README_1_STAGE.md @@ -84,11 +84,11 @@ The final dataset structure ## Set up the dataset configuration files -Then, set up the LAION dataset loading path in +Then, set up the absolute LAION dataset loading path in [here](../minigpt4/configs/datasets/laion/defaults.yaml#L5) at Line 5 as ${MINIGPT4_DATASET}/laion/laion_dataset/{00000..10488}.tar -and the Conceptual Captoin and SBU datasets loading path in +and the absolute Conceptual Captoin and SBU datasets loading path in [here](../minigpt4/configs/datasets/cc_sbu/defaults.yaml#L5) at Line 5 as ${MINIGPT4_DATASET}/cc_sbu/cc_sbu_dataset/{00000..01255}.tar diff --git a/dataset/README_2_STAGE.md b/dataset/README_2_STAGE.md index b826765f..e2e38932 100644 --- a/dataset/README_2_STAGE.md +++ b/dataset/README_2_STAGE.md @@ -14,6 +14,6 @@ cc_sbu_align ``` Put the folder to any path you want. -Then, set up the dataset path in the dataset config file +Then, set up the absolute dataset path in the dataset config file [here](../minigpt4/configs/datasets/cc_sbu/align.yaml#L5) at Line 5. From 58c665d75ec4a0d017152d4dc02023f009a5246f Mon Sep 17 00:00:00 2001 From: Sypherd Date: Tue, 19 Sep 2023 08:12:53 -0600 Subject: [PATCH 3/3] Specify relative path for output --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f09367ca..271aa5b5 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ our [first stage dataset preparation instruction](dataset/README_1_STAGE.md). After the first stage, the visual features are mapped and can be understood by the language model. To launch the first stage training, run the following command. In our experiments, we use 4 A100. -You can change the save path in the config file +You can change the relative save path in the config file [train_configs/minigpt4_stage1_pretrain.yaml](train_configs/minigpt4_stage1_pretrain.yaml) ```bash @@ -139,7 +139,7 @@ To download and prepare our second stage dataset, please check our To launch the second stage alignment, first specify the absolute path to the checkpoint file trained in stage 1 in [train_configs/minigpt4_stage1_pretrain.yaml](train_configs/minigpt4_stage2_finetune.yaml). -You can also specify the output path there. +You can also specify the relative output path there. Then, run the following command. In our experiments, we use 1 A100. ```bash