# Training QLoRA+QA-LoRA model

## Env setup

First, install the modified transformers
```
pip install -e transformers
```

Then, install all the dependencies
```
cd train
pip install -r requirements.txt
cd ../
```

## Prepare inherit checkpoints

+ Get the ckpt of Alpaca-lora

+ Convert the key to opendelta format (you could print out the opendelta keys first)

+ Change the path in `train/qlora_cpet.py:429`

## Train QA-LoRA

```
cd train
bash train.sh
```

Then get the clean QA-LoRA ckpt for further tests: use the script `train/clean.py`

## Test QA-LoRA

update the path in `instruct-eval/modelling.py:848`

```
cd instruct-eval
pip install -r requirements.txt
bash qlora_cpet.sh
```
