Instructions to use mjpsm/Llama-3.2-1B-Instruction-Chatbot-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use mjpsm/Llama-3.2-1B-Instruction-Chatbot-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B-Instruct") model = PeftModel.from_pretrained(base_model, "mjpsm/Llama-3.2-1B-Instruction-Chatbot-LoRA") - Notebooks
- Google Colab
- Kaggle
Llama 3.2 1B Instruction Chatbot (LoRA Adapter)
Overview
This repository contains a LoRA adapter fine-tuned from Meta's Llama 3.2 1B Instruct model using supervised instruction tuning.
This repository does not contain the base model. Users must have access to the original base model before loading this adapter.
The purpose of this project was educational—to learn the complete workflow of instruction tuning, QLoRA, PEFT, model evaluation, and deployment using Hugging Face.
Base Model
- meta-llama/Llama-3.2-1B-Instruct
Training Dataset
Approximately 40,000 instruction-response examples.
Dataset format:
- Instruction
- Optional Input
- Response
The dataset was converted into a conversational chat format using the Llama chat template prior to training.
Training Configuration
Fine-tuning Method
- QLoRA
- PEFT
- 4-bit NF4 Quantization
Frameworks
- Transformers
- TRL
- PEFT
- BitsAndBytes
- Accelerate
Hyperparameters
| Parameter | Value |
|---|---|
| Epochs | 1 |
| Batch Size | 2 |
| Gradient Accumulation | 4 |
| Learning Rate | 2e-4 |
| Optimizer | paged_adamw_8bit |
| Scheduler | Cosine |
| Precision | FP16 |
Training Results
| Metric | Value |
|---|---|
| Training Loss | 0.15088 |
| Runtime | 6789.63 seconds |
| Global Steps | 5000 |
| Samples / Second | 5.89 |
| Steps / Second | 0.736 |
Intended Uses
- Instruction following
- Conversational AI
- Educational projects
- Fine-tuning demonstrations
- Research
Limitations
This adapter was created for educational purposes.
It has not undergone extensive benchmark evaluation or safety alignment beyond the underlying base model.
Responses may contain inaccuracies or hallucinations.
Loading the Adapter
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Llama-3.2-1B-Instruct"
)
model = PeftModel.from_pretrained(
base_model,
"mjpsm/Llama-3.2-1B-Instruction-Chatbot-LoRA"
)
tokenizer = AutoTokenizer.from_pretrained(
"meta-llama/Llama-3.2-1B-Instruct"
)
Citation
If you use this adapter in your work, please cite this repository.
- Downloads last month
- 51
Model tree for mjpsm/Llama-3.2-1B-Instruction-Chatbot-LoRA
Base model
meta-llama/Llama-3.2-1B-Instruct