Downloads · 30 days
0
junaid17/finetuned-DeepSeek_r1
finetuned-DeepSeek_r1 is a machine learning model from junaid17. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This project demonstrates how to fine-tune the unsloth/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit model using the vicgalle/alpaca-gpt4 dataset with LoRA and Unsloth's efficient training interface.
Downloads · 30 days
0
Access
Public
Updated Jun 4, 2025
Repo size
168 MB
Likes
1
Public
Click a slice to open those files.
.safetensors168 MB · 100%
From the Hugging Face model README
This project demonstrates how to fine-tune the unsloth/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit model using the vicgalle/alpaca-gpt4 dataset with LoRA and Unsloth's efficient training interface.
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit",
max_seq_length = max_seq_length,
dtype=None,
load_in_4bit = True,
)
model = FastLanguageModel.get_peft_model(
model,
r = 16,
target_modules = [
"q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj"
],
use_rslora = True,
)
We use a subset (5,000 rows) of the Alpaca-GPT4 dataset for quick fine-tuning:
from datasets import load_dataset
dataset = load_dataset("vicgalle/alpaca-gpt4", split="train[:5000]")
All model checkpoints and logs are saved in the outputs/ directory.
apply_chat_template() helped match conversational finetuning structure.