preshent-llama / README.md
bhavyabgada's picture
Update README.md
3e856d4 verified
---
base_model: meta-llama/Llama-3.1-8B-Instruct
library_name: peft
tags:
- llama
- llama-3.1
- lora
- fine-tuned
- peft
---
# Fine-tuned Llama 3.1 8B Instruct Model
This is a fine-tuned version of Meta's [Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) model using LoRA (Low-Rank Adaptation) technique.
## Model Details
### Model Description
This model is a fine-tuned version of Llama 3.1 8B Instruct using PEFT (Parameter-Efficient Fine-Tuning) with LoRA. The fine-tuning process focused on adapting the base model to specific use cases while maintaining the general capabilities of the original model.
- **Developed by:** Bhavya Bipin Gada (PRESHENT)
- **Model type:** LoRA fine-tuned Llama 3.1
- **Language(s):** English
- **License:** MIT
- **Finetuned from model:** meta-llama/Llama-3.1-8B-Instruct
## Training Details
### Training Procedure
The model was fine-tuned using the following LoRA configuration:
- **LoRA rank (r):** 8
- **LoRA alpha:** 16
- **LoRA dropout:** 0.05
- **Target modules:** k_proj, q_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- **Task type:** CAUSAL_LM
### Training Data
```json
[
{
"messages": [
{
"role": "user",
"content": "What sustainable solutions do you offer for solar energy?"
},
{
"role": "assistant",
"content": "We offer rooftop solar panels, community solar options, and solar battery storage solutions optimized for your location."
}
]
},
{
"messages": [
{
"role": "user",
"content": "Can you recommend a sustainable water purification method?"
},
{
"role": "assistant",
"content": "Reverse osmosis systems powered by renewable energy are highly effective and sustainable."
}
]
}
]
```
## Usage
You can use this model with the Transformers library:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel, PeftConfig
# Load the base model
base_model_id = "meta-llama/Llama-3.1-8B-Instruct"
model = AutoModelForCausalLM.from_pretrained(base_model_id)
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
# Load the LoRA adapter
adapter_path = "bhavyabgada/preshent-llama"
model = PeftModel.from_pretrained(model, adapter_path)
# Generate text
input_text = "Your prompt here"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
## Limitations and Biases
This model inherits the limitations and biases from the base Llama 3.1 8B Instruct model.
## Framework versions
- PEFT 0.13.2