/SwinLLama

SwinLLama for medical report generation

Primary LanguagePython

SwinLLama: Enhancing Medical report generation with Advanced Large Language Models

Getting Started

Installation

1. Prepare the code and the environment

Git clone our repository and install the requirements.

git clone https://github.com/wang-zhanyu/SwinLLama.git
cd SwinLLama
pip install -r requirements.txt

2. Prepare the training dataset

We train SwinLLama on the MIMIC-CXR dataset You can dowmload the dataset from here and set base_dir to the file download path in the config file in configs/config_mimic.py at Line 8, for example, base_dir='physionet.org/files/mimic-cxr-jpg/2.0.0/files'.

The pre-processed reports can be download from here, after dwonlading, set the path of this file in the config file in configs/config_mimic.py at Line 7.

Launching Demo Locally

Try out our demo demo.py on your local machine by running

python demo.py --delta_file /path/to/pretrained/checkpoint

Training

To launch the training, run the following command. In our experiments, we use 2 3090GPU. You can change the save path in the config file configs/config_mimic.py

python train.py --gpus 2 --batch_size 4 --val_batch_size 4 --max_epochs 3 --savedmodel_path /path/to/savemodel

Acknowledgement

  • MiniGPT-4 Some codes of this repo are based on MiniGPT-4.
  • Vicuna The fantastic language ability of Vicuna with only 7B parameters is just amazing.

License

This repository is under BSD 3-Clause License.