Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Vishwesh Nath <[email protected]>
  • Loading branch information
finalelement committed Oct 24, 2024
1 parent b69faa7 commit 880b750
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion m3/data_prepare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Preparing the datasets for VILA training and testing requires three steps:
1. Downloading all the datasets (Information to download each dataset is provided in the readme.md for the `vqa`, `report` and `expert` directories)
2. Generating the instruction data for all datasets (Information to generate the instruction data is provided in the readme.md for the `vqa`, `report` and `expert` directory)
3. Adding the prepared datasets to VILA in a data mixture (More information can be found in the quickstart guide))
3. Adding the prepared datasets to VILA in a data mixture (More information can be found in the [quickstart guide](../train/readme.md))

### VQA Datasets
- PathVQA: Pathology-based VQA dataset with ~4,000 images and ~32,000 QA pairs, focusing on microscopic views of human tissue.
Expand Down
6 changes: 3 additions & 3 deletions m3/data_prepare/vqa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To download the RadVQA dataset, please visit this [link](https://osf.io/89kps/)

From the below screenshot, please ensure that the entire OSF Storage directory is downloaded.

![image](../../images/radvqa_osf.png)
![image](../../docs/images/radvqa_osf.png)

An execution of the instruction data generation python script is required on the downloaded OSF Storage data directory.

Expand All @@ -16,7 +16,7 @@ To download the SLAKE dataset, please visit this [link](https://www.med-vqa.com/

From the below screenshot, please note that we use the 'Google Drive' link to download the dataset.

![image](../../images/slake_web.png)
![image](../../docs/images/slake_web.png)

Once the dataset is downloaded, please unzip the files and place them in a temporary data directory. Execution of instruction data generation python script is required on the unzipped data directory

Expand All @@ -25,7 +25,7 @@ All files from the huggingface PathVQA dataset from the data directory need to b

Ensure that all 13 parquet files are present in the data directory before trying to generate the instruction data (see screenshot below). The python commands for running them are provided in the next section.

![image](../../images/pathvqa_hf.png)
![image](../../docs/images/pathvqa_hf.png)

## Generate Instruction Tuning Training Data
### RadVQA
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 12 additions & 0 deletions m3/train/m3-vila13b.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash

# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Set master address and worker list
master_addr="127.0.0.1"
export MASTER_ADDR=${master_addr}
Expand Down Expand Up @@ -45,6 +56,7 @@ CURRENT_RANK=0
n_node=1
echo "JobID: N/A | Full list: $worker_list | rank $CURRENT_RANK of $n_node"

# Upsampling datasets to balance the training data
HEALTHCARE_DS=$(for i in {1..10}; do echo -n usmle+; done)
HEALTHCARE_DS+=$(for i in {1..4}; do echo -n radvqa+; done)
HEALTHCARE_DS+=$(for i in {1..4}; do echo -n slake+; done)
Expand Down
12 changes: 12 additions & 0 deletions m3/train/m3-vila3b.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash

# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# User-defined variables
NODES=4
GPUS_PER_NODE=8
Expand Down Expand Up @@ -35,6 +46,7 @@ n_node=${NODES:-1}
echo "JobID: $SLURM_JOB_ID | Full list: $worker_list | rank $CURRENT_RANK of $n_node"

bs=32
# Upsampling datasets to balance the training data
HEALTHCARE_DS=$(for i in {1..10}; do echo -n usmle+; done)
HEALTHCARE_DS+=$(for i in {1..4}; do echo -n radvqa+; done)
HEALTHCARE_DS+=$(for i in {1..4}; do echo -n slake+; done)
Expand Down
12 changes: 12 additions & 0 deletions m3/train/m3-vila8b.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash

# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Set master address and worker list
master_addr=$(hostname)
export MASTER_ADDR=${master_addr:-"127.0.0.1"}
Expand Down Expand Up @@ -40,6 +51,7 @@ bs=16
STAGE2_PATH=$STAGE2_PATH
OUTPUT=provide_output_dir_name

# Upsampling datasets to balance the training data
HEALTHCARE_DS=$(for i in {1..10}; do echo -n usmle+; done)
HEALTHCARE_DS+=$(for i in {1..4}; do echo -n radvqa+; done)
HEALTHCARE_DS+=$(for i in {1..4}; do echo -n slake+; done)
Expand Down
4 changes: 2 additions & 2 deletions m3/train/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Training Recipe For M3
# Quickstart Guide: Training Recipe For M3

The M3-VILA is based on [VILA-v1.5](https://github.com/NVlabs/VILA).

Expand All @@ -15,7 +15,7 @@ For each model variant type, different large language models (LLM's) and vision
Please address the below in the training bash scripts before trying to execute them:

#### Define paths (replace with actual paths)
1.) STAGE2_PATH="/path/to/your/model", these are VILA pre-trained checkpoints, the link to download them can be found [here](https://github.com/NVlabs/VILA#pre-trained-models).
1.) STAGE2_PATH="/path/to/your/model", these are VILA pre-trained checkpoints, they can be found [here](https://github.com/NVlabs/VILA#pre-trained-models).

2.) OUTPUT_DIR="/path/to/output/checkpoints"

Expand Down

0 comments on commit 880b750

Please sign in to comment.