conda create -n patchwork-env python=3.10 -y conda activate patchwork-env conda deactivate
pip install -r requirements.txt
https://drive.google.com/file/d/1S0SmU0WEw5okW_XvP2Ns0URflNzZq6sV/view
Edit the train_replay.sh
model_name_or_path: Path where model is placed.
data_path: Path of dataset.
dataset_name: List of tasks on which you want to fine-tune the model.
output_dir: Path where you want to save the model.
Run:
cd fine-tuning bash train_replay.sh
Edit the infer_seq.sh.
data_path: Path to test dataset.
inference_tasks: Tasks on which you want to run ineference.
model_name_or_path: Path where model is placed.
inference_model_path: Path where model is placed.
tokenizer_model_path: Path where tokenizer is placed.
inference_output_path: Path where you want to save the ineference results.
Run bash infer_seq.sh
Edit the infer_test.sh.
data_path: Path to test dataset.
inference_tasks: Tasks on which you want to run ineference.
model_name_or_path: Path where model is placed.
inference_model_path: Path where model is placed.
tokenizer_model_path: Path where tokenizer is placed.
inference_output_path: Path where you want to save the ineference results.
Run bash infer_test.sh
cd GPTQ
In the quantize_gptq.py file
Set pretrained_model_dir to the path of model you want to quantize.
Set quantized_model_dir to the path where the model should be saved.
cd Delta_Compression
Run the patchwork_demo.ipynb notebook to calculate the delta between 2 models.