Follow these steps to get started quickly:
-
Clone the Repository
Clone the repository to your local machine:git clone https://github.com/sunshine-JLU/deepseek-r1-distill-qwen-7B-lora.git cd deepseek-r1-distill-qwen-7B-lora -
Enviroment
pip install -r requirements.txt
-
Download the Model
Set the Hugging Face endpoint and download the deepseek-r1-distill-llama-8b model:modelscope download --model deepseek-ai/DeepSeek-R1-Distill-Qwen-7B --local_dir ./DeepSeek-R1-Distill-Qwen-7B
-
Run the Notebook
Open and run the DeepSeek-R1-Distill-Qwen-7B.ipynb notebook to start fine-tuning the model. -
Run the lora-model in the lora_model_inference.ipynb
After you successfully run over the DeepSeek-R1-Distill-Qwen-7B.ipynb, You will get a number of checkpoint files, each file is a lora weight that can be loaded independently, you can specify the lora file address in the lora_model_inference.ipynb to load and run.
GPU Memory at least 48GB would not appear OOM problem.

I deploy this program under PyTorch 2.3.0 ,Python 3.12(ubuntu22.04), Cuda 12.1