This is a step-by-step process to execute this code. Please make sure the config.py file is up to date.
Steps to execute the code:
- Create necessary directories.
mkdir data base_models saved_models
- Download the MATH dataset and store it in the data folder.
cd data
wget https://people.eecs.berkeley.edu/~hendrycks/MATH.tar
tar -xvf MATH.tar
cd ..
- Create conda environment using environment.yml.
conda env create -f environment.yml
- Activate the environment.
conda activate llm-self-correct
- Create folder base_models and download the base model from Huggingface by running main.py in download task. Please note a token might be required to access certain models.
cd code/
python main.py --task download
- Once downloaded, run the main.py in train task.
python main.py --task train
Or, use the run.slurm file for submitting a job in HPRC.
cd ..
sbatch run.slurm
- To run the saved model in evaluation mode, use the following command.
python main.py --task evaluate